Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProviderNotFound = errors.New("provider not found") ErrManagerNotInit = errors.New("manager is not init") )
Functions ¶
This section is empty.
Types ¶
type ExchangeProvider ¶
type ExchangeProvider interface { Name() string Ticker() TickerProvider }
ExchangeProvider interface
type Manager ¶
type Manager map[string]ExchangeProvider
Manager of ExchangeProvider
func (Manager) Add ¶
func (m Manager) Add(exchange ExchangeProvider)
Add sets the key to value. It replaces any existing values.
type Product ¶
Product struct
func NewProductFromString ¶
NewProductFromString create product object
func (Product) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (*Product) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It support string and null input.
type TickerEvent ¶
type TickerEvent struct { Product Product `json:"product"` Price float64 `json:"price"` Side SideType `json:"side"` Time time.Time `json:"time"` Size float64 `json:"size"` }
TickerEvent struct
type TickerProvider ¶
type TickerProvider interface { Subscribe(products ...Product) error Unsubscribe(products ...Product) error Channel() <-chan *TickerEvent }
TickerProvider interface
Click to show internal directories.
Click to hide internal directories.