github.com/angryronald/go-kit@v0.0.0-20240505173814-ff2bd9c79dbf/generic/http/client/client.interface.go (about)

     1  package client
     2  
     3  import (
     4  	"context"
     5  	"net/http"
     6  
     7  	"github.com/angryronald/go-kit/constant"
     8  )
     9  
    10  // GenericHTTPClient represents an interface to generalize an object to implement HTTPClient
    11  type GenericHTTPClient interface {
    12  	Do(req *http.Request) (string, *ResponseError)
    13  	CallClient(ctx context.Context, path string, method constant.HTTPMethod, request interface{}, result interface{}) *ResponseError
    14  	CallClientWithCachingInRedis(ctx context.Context, durationInSecond int, path string, method constant.HTTPMethod, request interface{}, result interface{}) *ResponseError
    15  	CallClientWithCachingInRedisWithDifferentKey(ctx context.Context, durationInSecond int, path string, pathToBeStoredAsKey string, method constant.HTTPMethod, request interface{}, result interface{}) *ResponseError
    16  	CallClientWithCircuitBreaker(ctx context.Context, path string, method constant.HTTPMethod, request interface{}, result interface{}) *ResponseError
    17  	CallClientWithBaseURLGiven(ctx context.Context, url string, method constant.HTTPMethod, request interface{}, result interface{}) *ResponseError
    18  	CallClientWithRequestInBytes(ctx context.Context, path string, method constant.HTTPMethod, request []byte, result interface{}) *ResponseError
    19  	AddAuthentication(ctx context.Context, authorizationType AuthorizationType)
    20  }