client

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCClientConnectionBuilder

type GRPCClientConnectionBuilder interface {
	AddOptions(opts ...grpc.DialOption) GRPCClientConnectionBuilder
	Build() GRPCClientConnectionWrapper
}

GRPCClientConnectionBuilder is a convenience builder to gather []grpc.DialOption

type GRPCClientConnectionWrapper

type GRPCClientConnectionWrapper interface {
	// Context can be nil
	Dial(ctx context.Context, target string, extraOptions ...grpc.DialOption) (grpc.ClientConnInterface, error)
}

GRPCClientConnectionWrapper is a convenience wrapper to support predefined dial Options provided by GRPCClientConnectionBuilder

type HTTPClientBuilder

type HTTPClientBuilder interface {
	AddInterceptors(...HTTPClientInterceptor) HTTPClientBuilder
	WithPreconfiguredClient(*http.Client) HTTPClientBuilder
	Build() *http.Client
}

HTTPClientBuilder is a builder interface to build http.Client with interceptors

type HTTPClientInterceptor

type HTTPClientInterceptor func(*http.Request, HTTPHandler) (*http.Response, error)

HTTPClientInterceptor is a user defined function that can alter a request before it's sent and/or alter a response before it's returned to the caller

type HTTPHandler added in v0.1.5

type HTTPHandler func(*http.Request) (*http.Response, error)

HTTPHandler is just an alias to http.RoundTriper.RoundTrip function

type NewHTTPClientBuilder

type NewHTTPClientBuilder func() HTTPClientBuilder

NewHTTPClientBuilder REST HTTP builder

Useful when you want to create several *http.Client with different options

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

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