Documentation ¶
Index ¶
- type Mux
- func (m *Mux) Close() bool
- func (m *Mux) IsConnected() bool
- func (m *Mux) Listen(cb func(interface{}, error)) error
- func (m *Mux) Send(pld interface{}) error
- func (m *Mux) Start() *Mux
- func (m *Mux) Subscribe(sub event.Subscribe) *Mux
- func (m *Mux) TransformRaw() *Mux
- func (m *Mux) WithAPIKEY(key string) *Mux
- func (m *Mux) WithAPISEC(sec string) *Mux
- func (m *Mux) WithAuthURL(url string) *Mux
- func (m *Mux) WithDeadManSwitch() *Mux
- func (m *Mux) WithPublicURL(url string) *Mux
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mux ¶
type Mux struct { Err error // contains filtered or unexported fields }
Mux will manage all connections and subscriptions. Will check if subscriptions limit is reached and spawn new connection when that happens. It will also listen to all incomming client messages and reconnect client with all its subscriptions in case of a failure
func (*Mux) IsConnected ¶
func (*Mux) Listen ¶
Listen accepts a callback func that will get called each time mux receives a message from any of its clients/subscriptions. It should be called last, after all setup calls are made
func (*Mux) Send ¶
Send meant for authenticated input, takes payload in form of interface and calls client with it
func (*Mux) Subscribe ¶
Subscribe - given the details in form of event.Subscribe, subscribes client to public channels. If rate limit is reached, calls itself recursively after 1s with same params
func (*Mux) TransformRaw ¶
TransformRaw enables data transformation and mapping to appropriate models before sending it to consumer
func (*Mux) WithAPIKEY ¶
WithAPIKEY accepts and persists api key
func (*Mux) WithAPISEC ¶
WithAPISEC accepts and persists api secret
func (*Mux) WithAuthURL ¶
WithAuthURL accepts and persists auth api url
func (*Mux) WithDeadManSwitch ¶
WithDeadManSwitch - when socket is closed, cancel all account orders
func (*Mux) WithPublicURL ¶
WithPublicURL accepts and persists public api url