factory

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type APIFactory

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

func NewAPIFactory

func NewAPIFactory(config *HttpClientConfig) *APIFactory

func (*APIFactory) ApiPassphrase

func (f *APIFactory) ApiPassphrase(apiPassphrase string) *APIFactory

func (*APIFactory) BuildFuture

func (f *APIFactory) BuildFuture(exName string) (api _interface.FutureRestAPI)

func (*APIFactory) BuildFuturesWs

func (f *APIFactory) BuildFuturesWs(exName string) (_interface.FuturesWsApi, error)

func (*APIFactory) BuildSpotWs

func (f *APIFactory) BuildSpotWs(exName string) (_interface.SpotWsApi, error)

func (*APIFactory) BuildWallet

func (f *APIFactory) BuildWallet(exName string) (_interface.WalletAPI, error)

func (*APIFactory) ClientID

func (f *APIFactory) ClientID(id string) *APIFactory

func (*APIFactory) Create

func (f *APIFactory) Create(exName string) _interface.API

func (*APIFactory) GetHttpClient

func (f *APIFactory) GetHttpClient() *http.Client

func (*APIFactory) GetHttpClientConfig

func (f *APIFactory) GetHttpClientConfig() *HttpClientConfig

func (*APIFactory) HttpProxy

func (f *APIFactory) HttpProxy(proxyUrl string) *APIFactory

func (*APIFactory) HttpTimeout

func (f *APIFactory) HttpTimeout(timeout time.Duration) *APIFactory

func (*APIFactory) SetAPIKey

func (f *APIFactory) SetAPIKey(key string) *APIFactory

func (*APIFactory) SetAPISecretkey

func (f *APIFactory) SetAPISecretkey(key string) *APIFactory

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