Documentation
¶
Overview ¶
Package v1 is a generated GoMock package.
Index ¶
- Constants
- func DecodeResponse[RESP any](ctx context.Context, response *http.Response) (interface{}, error)
- func EncodeRequest[REQ any](ctx context.Context, request *http.Request, req HTTPRequest[REQ]) error
- type Client
- type ClientBuilder
- func (b *ClientBuilder[REQ, RESP]) Build() Client[REQ, RESP]
- func (b *ClientBuilder[REQ, RESP]) Use(middleware Middleware[REQ, RESP]) *ClientBuilder[REQ, RESP]
- func (b *ClientBuilder[REQ, RESP]) UseMany(middlewares ...Middleware[REQ, RESP]) *ClientBuilder[REQ, RESP]
- func (b *ClientBuilder[REQ, RESP]) WithOptions(options ...http_transport.ClientOption) *ClientBuilder[REQ, RESP]
- type Endpoint
- type HTTPRequest
- type Middleware
- type MockClient
- type MockClientMockRecorder
- type NilBody
Constants ¶
const ( // HTTPMethodPost is the HTTP POST method. HTTPMethodPost = "POST" // HTTPMethodGet is the HTTP GET method. HTTPMethodGet = "GET" // HTTPMethodPut is the HTTP PUT method. HTTPMethodPut = "PUT" // HTTPMethodDelete is the HTTP DELETE method. HTTPMethodDelete = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
func DecodeResponse ¶
func EncodeRequest ¶
Types ¶
type Client ¶
Client interface provides a standard endpoint with request/response conversion capabilities
func NewHTTPClient ¶
func NewHTTPClient[REQ any, RESP any](method, path string, options ...http_transport.ClientOption) Client[REQ, RESP]
NewHTTPClient creates a new HTTP client with optional http_transport.ClientOption
type ClientBuilder ¶ added in v1.0.8
ClientBuilder provides a fluent API for constructing HTTP clients with middlewares
func NewClientBuilder ¶ added in v1.0.8
func NewClientBuilder[REQ any, RESP any](method, path string) *ClientBuilder[REQ, RESP]
NewClientBuilder creates a new ClientBuilder for the specified HTTP method and path
func (*ClientBuilder[REQ, RESP]) Build ¶ added in v1.0.8
func (b *ClientBuilder[REQ, RESP]) Build() Client[REQ, RESP]
Build constructs the Client with all configured middlewares applied
func (*ClientBuilder[REQ, RESP]) Use ¶ added in v1.0.8
func (b *ClientBuilder[REQ, RESP]) Use(middleware Middleware[REQ, RESP]) *ClientBuilder[REQ, RESP]
Use adds a single middleware to the builder
func (*ClientBuilder[REQ, RESP]) UseMany ¶ added in v1.0.8
func (b *ClientBuilder[REQ, RESP]) UseMany(middlewares ...Middleware[REQ, RESP]) *ClientBuilder[REQ, RESP]
UseMany adds multiple middlewares to the builder
func (*ClientBuilder[REQ, RESP]) WithOptions ¶ added in v1.0.8
func (b *ClientBuilder[REQ, RESP]) WithOptions(options ...http_transport.ClientOption) *ClientBuilder[REQ, RESP]
WithOptions adds http_transport.ClientOption to the builder
type Endpoint ¶
type HTTPRequest ¶
type Middleware ¶ added in v1.0.8
Middleware wraps an Endpoint and returns a new Endpoint
func Chain ¶ added in v1.0.8
func Chain[REQ any, RESP any](middlewares ...Middleware[REQ, RESP]) Middleware[REQ, RESP]
Chain applies multiple middlewares in order (first middleware wraps outermost)
type MockClient ¶
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient[REQ any, RESP any](ctrl *gomock.Controller) *MockClient[REQ, RESP]
NewMockClient creates a new mock instance.
func (*MockClient[REQ, RESP]) EXPECT ¶
func (m *MockClient[REQ, RESP]) EXPECT() *MockClientMockRecorder[REQ, RESP]
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient[REQ, RESP]) Endpoint ¶
func (m *MockClient[REQ, RESP]) Endpoint() Endpoint[REQ, RESP]
Endpoint mocks base method.
type MockClientMockRecorder ¶
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder[REQ, RESP]) Endpoint ¶
func (mr *MockClientMockRecorder[REQ, RESP]) Endpoint() *gomock.Call
Endpoint indicates an expected call of Endpoint.