builder

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: MIT Imports: 26 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) BuildFuturesWs added in v1.2.3

func (builder *APIBuilder) BuildFuturesWs(exName string) (FuturesWsApi, error)

func (*APIBuilder) BuildSpotWs added in v1.2.3

func (builder *APIBuilder) BuildSpotWs(exName string) (SpotWsApi, error)

func (*APIBuilder) BuildWallet added in v1.2.3

func (builder *APIBuilder) BuildWallet(exName string) (WalletApi, error)

func (*APIBuilder) ClientID

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

func (*APIBuilder) Endpoint added in v1.2.3

func (builder *APIBuilder) Endpoint(endpoint string) (_builer *APIBuilder)

func (*APIBuilder) FuturesEndpoint added in v1.2.3

func (builder *APIBuilder) FuturesEndpoint(endpoint 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