Documentation ¶
Index ¶
- Constants
- func HTTPClientOptions() []httptransport.ClientOption
- func InjectTokenContextRequest() httpkit.RequestFunc
- func LoadConfig() (*viper.Viper, error)
- func NewEndpoint(host, method string, enc httptransport.EncodeRequestFunc, ...) (endpoint.Endpoint, error)
- func PopulateWithToken(ctx context.Context, token string) (context.Context, error)
- func String(v string) *string
- func StringValue(v *string) string
- type HTTPClientConfig
- type Middleware
- type MiddlewareProvider
Constants ¶
View Source
const Token = "api-token"
Variables ¶
This section is empty.
Functions ¶
func HTTPClientOptions ¶
func HTTPClientOptions() []httptransport.ClientOption
HTTPClientOptions provides the standard set of http client options.
func InjectTokenContextRequest ¶
func InjectTokenContextRequest() httpkit.RequestFunc
InjectTokenContextRequest add token in to query.
func LoadConfig ¶
LoadConfig loads config in order flag > file
func NewEndpoint ¶
func NewEndpoint(host, method string, enc httptransport.EncodeRequestFunc, dec httptransport.DecodeResponseFunc, opts ...httptransport.ClientOption) (endpoint.Endpoint, error)
NewEndpoint returns new go-kit endpoint.
func PopulateWithToken ¶
PopulateWithToken puts token into context.
func StringValue ¶
StringValue returns the value of the string pointer.
Types ¶
type HTTPClientConfig ¶
type HTTPClientConfig struct { Host string Middlewarer MiddlewareProvider }
HTTPClientConfig is the common config for the http clients. TODO add tracer, logger
func MakeHTTPClientConfig ¶
func MakeHTTPClientConfig(host string, middlewarer MiddlewareProvider) HTTPClientConfig
MakeHTTPClientConfig creates a new config for a HTTP client.
type MiddlewareProvider ¶
MiddlewareProvider is the type to provide the endpoint middleware.
func ClientMiddlewareProvider ¶
func ClientMiddlewareProvider() MiddlewareProvider
Click to show internal directories.
Click to hide internal directories.