Documentation
¶
Index ¶
- Variables
- func IsTestnet(ctx context.Context) bool
- func New(ctx context.Context, opts Options) context.Context
- func ParseTime(unixSec util.Number) (time.Time, error)
- func UpdateServerTime(ctx context.Context, serverTime time.Time)
- type Base
- type BaseResult
- type Context
- type Options
- type Websocket
- type WebsocketEndpoints
- type WebsocketRequest
- type WebsocketResponse
- type WebsocketStatusResponse
- type WebsocketTopicResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var WebsocketEndpoint = struct { Mainnet WebsocketEndpoints Testnet WebsocketEndpoints }{ Mainnet: WebsocketEndpoints{ Public: "wss://stream.bybit.com/realtime_public", Private: "wss://stream.bybit.com/realtime_private", }, Testnet: WebsocketEndpoints{ Public: "wss://stream-testnet.bybit.com/realtime_public", Private: "wss://stream-testnet.bybit.com/realtime_private", }, }
Functions ¶
Types ¶
type BaseResult ¶
type BaseResult struct { RetCode int `json:"ret_code"` RetMsg string `json:"ret_msg"` ExtCode string `json:"ext_code"` Result interface{} `json:"result"` TimeNow util.Number `json:"time_now"` RateLimitStatus int `json:"rate_limit_status"` }
func (*BaseResult) ReturnCode ¶
func (b *BaseResult) ReturnCode() int
func (*BaseResult) ReturnMessage ¶
func (b *BaseResult) ReturnMessage() string
func (*BaseResult) ServerTime ¶
func (b *BaseResult) ServerTime() util.Number
type Context ¶
func FromContext ¶
type Websocket ¶
type Websocket struct { Options // contains filtered or unexported fields }
func NewWebsocket ¶
func NewWebsocket(opts Options, handlerFn func(*WebsocketResponse)) *Websocket
type WebsocketEndpoints ¶
type WebsocketRequest ¶
type WebsocketRequest struct { Op string `json:"op"` Args []interface{} `json:"args"` }
type WebsocketResponse ¶
func (*WebsocketResponse) IsStatusResponse ¶
func (r *WebsocketResponse) IsStatusResponse() bool
func (*WebsocketResponse) IsTopicResponse ¶
func (r *WebsocketResponse) IsTopicResponse() bool
func (*WebsocketResponse) StatusResponse ¶
func (r *WebsocketResponse) StatusResponse() (*WebsocketStatusResponse, error)
func (*WebsocketResponse) TopicResponse ¶
func (r *WebsocketResponse) TopicResponse() (*WebsocketTopicResponse, error)
type WebsocketStatusResponse ¶
type WebsocketStatusResponse struct { Success bool `json:"success"` RetMsg string `json:"ret_msg"` ConnID string `json:"conn_id"` Request WebsocketRequest `json:"request"` }
WebsocketStatusResponse occurs on error or subscription confirmation
type WebsocketTopicResponse ¶
type WebsocketTopicResponse struct { Topic string `json:"topic"` Type string `json:"type"` Data json.RawMessage `json:"data"` }
Click to show internal directories.
Click to hide internal directories.