common

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitgetBaseWsClient

type BitgetBaseWsClient struct {
	NeedLogin        bool
	Connection       bool
	LoginStatus      bool
	Listener         OnReceive
	ErrorListener    OnReceive
	Ticker           *time.Ticker
	SendMutex        *sync.Mutex
	WebSocketClient  *websocket.Conn
	LastReceivedTime time.Time
	AllSuribe        *model.Set
	Signer           *Signer
	ScribeMap        map[model.SubscribeReq]OnReceive
	BooksMap         map[model.SubscribeReq]model.BookInfo
}

func (*BitgetBaseWsClient) CheckSum

func (p *BitgetBaseWsClient) CheckSum(jsonMap map[string]interface{}) bool

func (*BitgetBaseWsClient) Connect

func (p *BitgetBaseWsClient) Connect()

func (*BitgetBaseWsClient) ConnectWebSocket

func (p *BitgetBaseWsClient) ConnectWebSocket()

func (*BitgetBaseWsClient) DisconnectWebSocket

func (p *BitgetBaseWsClient) DisconnectWebSocket()

func (*BitgetBaseWsClient) ExecuterPing

func (p *BitgetBaseWsClient) ExecuterPing()

func (*BitgetBaseWsClient) GetListener

func (p *BitgetBaseWsClient) GetListener(argJson interface{}) OnReceive

func (*BitgetBaseWsClient) Init

func (*BitgetBaseWsClient) Login

func (p *BitgetBaseWsClient) Login()

func (*BitgetBaseWsClient) ReadLoop

func (p *BitgetBaseWsClient) ReadLoop()

func (*BitgetBaseWsClient) Send

func (p *BitgetBaseWsClient) Send(data string)

func (*BitgetBaseWsClient) SendByType

func (p *BitgetBaseWsClient) SendByType(req model.WsBaseReq)

func (*BitgetBaseWsClient) SetListener

func (p *BitgetBaseWsClient) SetListener(msgListener OnReceive, errorListener OnReceive)

func (*BitgetBaseWsClient) StartReadLoop

func (p *BitgetBaseWsClient) StartReadLoop()

type BitgetRestClient

type BitgetRestClient struct {
	ApiKey       string
	ApiSecretKey string
	Passphrase   string
	BaseUrl      string
	HttpClient   *http.Client
	Signer       *Signer
}

func (*BitgetRestClient) DoGet

func (p *BitgetRestClient) DoGet(uri string, params map[string]string) (string, error)

func (*BitgetRestClient) DoPost

func (p *BitgetRestClient) DoPost(uri string, params string) (string, error)

func (*BitgetRestClient) Init

func (*BitgetRestClient) InitWithCreds

func (p *BitgetRestClient) InitWithCreds(creds *config.ApiCreds) *BitgetRestClient

type CommonResponse

type CommonResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
}

type OnReceive

type OnReceive func(message string)

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

func (*Signer) Init

func (p *Signer) Init(key string) *Signer

func (*Signer) Sign

func (p *Signer) Sign(method string, requestPath string, body string, timesStamp string) string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL