sdk

package
v0.0.0-...-415ebe7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func LoadConfig() (*viper.Viper, error)

LoadConfig loads config in order flag > file

func NewEndpoint

NewEndpoint returns new go-kit endpoint.

func PopulateWithToken

func PopulateWithToken(ctx context.Context, token string) (context.Context, error)

PopulateWithToken puts token into context.

func String

func String(v string) *string

String returns a pointer to the string.

func StringValue

func StringValue(v *string) string

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 Middleware

type Middleware struct {
}

Middleware is a metrics middleware.

type MiddlewareProvider

type MiddlewareProvider func(key string, edp endpoint.Endpoint) endpoint.Endpoint

MiddlewareProvider is the type to provide the endpoint middleware.

func ClientMiddlewareProvider

func ClientMiddlewareProvider() MiddlewareProvider

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL