builder

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHttpClientConfig = &HttpClientConfig{
		Proxy:        nil,
		HttpTimeout:  5 * time.Second,
		MaxIdleConns: 10}
	DefaultAPIBuilder = NewAPIBuilder()
)

Functions

This section is empty.

Types

type APIBuilder

type APIBuilder struct {
	HttpClientConfig *HttpClientConfig
	// contains filtered or unexported fields
}

func NewAPIBuilder

func NewAPIBuilder() (builder *APIBuilder)

func NewAPIBuilder2

func NewAPIBuilder2(config *HttpClientConfig) *APIBuilder

func NewCustomAPIBuilder

func NewCustomAPIBuilder(client *http.Client) (builder *APIBuilder)

func (*APIBuilder) APIKey

func (builder *APIBuilder) APIKey(key string) (_builder *APIBuilder)

func (*APIBuilder) APISecretkey

func (builder *APIBuilder) APISecretkey(key string) (_builder *APIBuilder)

func (*APIBuilder) ApiPassphrase

func (builder *APIBuilder) ApiPassphrase(apiPassphrase string) (_builder *APIBuilder)

func (*APIBuilder) Build

func (builder *APIBuilder) Build(exName string) (api API)

func (*APIBuilder) BuildFuture

func (builder *APIBuilder) BuildFuture(exName string) (api FutureRestAPI)

func (*APIBuilder) ClientID

func (builder *APIBuilder) ClientID(id string) (_builder *APIBuilder)

func (*APIBuilder) GetHttpClient

func (builder *APIBuilder) GetHttpClient() *http.Client

func (*APIBuilder) GetHttpClientConfig

func (builder *APIBuilder) GetHttpClientConfig() *HttpClientConfig

func (*APIBuilder) HttpProxy

func (builder *APIBuilder) HttpProxy(proxyUrl string) (_builder *APIBuilder)

func (*APIBuilder) HttpTimeout

func (builder *APIBuilder) HttpTimeout(timeout time.Duration) (_builder *APIBuilder)

type HttpClientConfig

type HttpClientConfig struct {
	HttpTimeout  time.Duration
	Proxy        *url.URL
	MaxIdleConns int
}

func (*HttpClientConfig) SetHttpTimeout

func (c *HttpClientConfig) SetHttpTimeout(timeout time.Duration) *HttpClientConfig

func (*HttpClientConfig) SetMaxIdleConns

func (c *HttpClientConfig) SetMaxIdleConns(max int) *HttpClientConfig

func (*HttpClientConfig) SetProxyUrl

func (c *HttpClientConfig) SetProxyUrl(proxyUrl string) *HttpClientConfig

func (HttpClientConfig) String

func (c HttpClientConfig) String() string

Jump to

Keyboard shortcuts

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