Documentation
¶
Index ¶
- Constants
- func GetSessionAttributes(exchange types.Exchange) (isMargin, isFutures, isIsolated bool, isolatedSymbol string)
- func IsMaxExchange(exchange interface{}) bool
- func New(n types.ExchangeName, options ExchangeOptions) (types.ExchangeMinimal, error)
- func NewPublic(exchangeName types.ExchangeName) (types.Exchange, error)
- func NewWithEnvVarPrefix(n types.ExchangeName, varPrefix string) (types.ExchangeMinimal, error)
- func RegisterExchange(name types.ExchangeName, factory ExchangeFactory)
- type ExchangeConstructor
- type ExchangeEnvLoader
- type ExchangeFactory
- type ExchangeOptions
Constants ¶
View Source
const ( ExchangeOptionsKeyAPIKey = "API_KEY" ExchangeOptionsKeyAPISecret = "API_SECRET" ExchangeOptionsKeyAPIPassphrase = "API_PASSPHRASE" )
Variables ¶
This section is empty.
Functions ¶
func GetSessionAttributes ¶ added in v1.37.0
func IsMaxExchange ¶ added in v1.58.0
func IsMaxExchange(exchange interface{}) bool
func New ¶
func New(n types.ExchangeName, options ExchangeOptions) (types.ExchangeMinimal, error)
func NewWithEnvVarPrefix ¶
func NewWithEnvVarPrefix(n types.ExchangeName, varPrefix string) (types.ExchangeMinimal, error)
NewWithEnvVarPrefix allocate and initialize the exchange instance with the given environment variable prefix When the varPrefix is a empty string, the default exchange name will be used as the prefix
func RegisterExchange ¶ added in v1.62.0
func RegisterExchange(name types.ExchangeName, factory ExchangeFactory)
Types ¶
type ExchangeConstructor ¶ added in v1.62.0
type ExchangeConstructor func(ExchangeOptions) (types.Exchange, error)
ExchangeConstructor is a function type to create an exchange instance with the given options
type ExchangeEnvLoader ¶ added in v1.62.0
type ExchangeEnvLoader func(varPrefix string) (ExchangeOptions, error)
ExchangeEnvLoader is a function type to load exchange options from environment variables According to pkg/bbgo/environment.go, we must to get the environment variable with %s-api-key so that we can add this custom exchange.
type ExchangeFactory ¶ added in v1.62.0
type ExchangeFactory struct { EnvLoader ExchangeEnvLoader Constructor ExchangeConstructor }
type ExchangeOptions ¶ added in v1.62.0
ExchangeOptions is a map of exchange options used to initialize an exchange
func DefaultEnvVarLoader ¶ added in v1.62.0
func DefaultEnvVarLoader(varPrefix string) (ExchangeOptions, error)
Directories
¶
Path | Synopsis |
---|---|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Code generated by go generate; DO NOT EDIT.
|
Code generated by go generate; DO NOT EDIT. |
Code generated by go generate; DO NOT EDIT.
|
Code generated by go generate; DO NOT EDIT. |
Code generated by go:generate; DO NOT EDIT.
|
Code generated by go:generate; DO NOT EDIT. |
Code generated by go generate; DO NOT EDIT.
|
Code generated by go generate; DO NOT EDIT. |
Click to show internal directories.
Click to hide internal directories.