Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClear = errors.New("handleMessages closed") ErrNotRunning = errors.New("client is not running") )
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
// contains filtered or unexported fields
}
Call request message send from client to server
type Conn ¶
type Conn interface { //Call send request from client to server. if r is not nil the //Call will be waiting for the server return and set dest via json.Unmarshal Call(ctx context.Context, id string, method string, params interface{}, dest interface{}) error //Run start a gorotuine loop for notify message from server //and call handler for each message Run(ctx context.Context, handler Handler) //Done being closed if running loop was done Done() <-chan struct{} //Error return err if running loop stop due to error Error() error //Close stop the running loop Close() error }
Conn a connection bettwen the client and server
type MsgError ¶
MsgError means the Msg format is not support by the Codec and encode/decode stream data fail
func NewMsgError ¶
type Notify ¶
type Notify struct { Method string Params interface{} }
Notify implement Response interface. subscribe messages from server (kline, orders...)
type Result ¶
type Result struct { ID string Error error Result json.RawMessage }
Result call result reply from server the Result field will be parsed via json.Unmarshal
type StreamError ¶
type StreamError struct {
Err error
}
StreamError means there is something wrong with Stream underlying transport layer. StreamError will make conn being closed
func NewStreamError ¶
func NewStreamError(err error) *StreamError
func (*StreamError) Error ¶
func (ce *StreamError) Error() string
func (*StreamError) Is ¶
func (ce *StreamError) Is(err error) bool
Click to show internal directories.
Click to hide internal directories.