common

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 19 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 {
	WsUrl            string
	NeedLogin        bool
	Connection       bool
	LoginStatus      bool
	Listener         model.OnReceive
	ErrorListener    model.OnError
	Ticker           *time.Ticker
	SendMutex        *sync.Mutex
	WebSocketClient  *websocket.Conn
	LastReceivedTime time.Time
	AllSuribe        *model.Set
	Signer           *Signer
	ScribeMapS       *model.Subs
	BooksMap         map[model.SubscribeReq]model.BookInfo
}

func (*BitgetBaseWsClient) CheckSum

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

CheckSum хз че за метод, но связан с books. Пока-что всегда возвращает true

func (*BitgetBaseWsClient) Connect

func (p *BitgetBaseWsClient) Connect()

func (*BitgetBaseWsClient) ConnectWebSocket

func (p *BitgetBaseWsClient) ConnectWebSocket() error

ConnectWebSocket Подключение к websocket серверу

func (*BitgetBaseWsClient) DisconnectWebSocket

func (p *BitgetBaseWsClient) DisconnectWebSocket() error

func (*BitgetBaseWsClient) ExecuterPing

func (p *BitgetBaseWsClient) ExecuterPing()

func (*BitgetBaseWsClient) GetListener

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

func (*BitgetBaseWsClient) Init

func (*BitgetBaseWsClient) Login

func (p *BitgetBaseWsClient) Login() error

func (*BitgetBaseWsClient) ReadLoop

func (p *BitgetBaseWsClient) ReadLoop(ctx context.Context)

ReadLoop вычитка сообщений из websocket канала Тут происходит вся магия с резолвом обработчика

func (*BitgetBaseWsClient) Send

func (p *BitgetBaseWsClient) Send(data string) error

func (*BitgetBaseWsClient) SendByType

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

func (*BitgetBaseWsClient) SetListener

func (p *BitgetBaseWsClient) SetListener(msgListener model.OnReceive, errorListener model.OnError)

func (*BitgetBaseWsClient) StartReadLoop

func (p *BitgetBaseWsClient) StartReadLoop(ctx context.Context)

type BitgetRestClient

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

func (*BitgetRestClient) DoGet

func (p *BitgetRestClient) DoGet(ctx context.Context, uri string, params map[string]string) (string, error)

func (*BitgetRestClient) DoPost

func (p *BitgetRestClient) DoPost(ctx context.Context, uri string, params string) (string, error)

func (*BitgetRestClient) Init

func (*BitgetRestClient) InitSigner added in v0.0.8

func (p *BitgetRestClient) InitSigner(secretKey string)

func (*BitgetRestClient) InitWithCreds

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

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

Jump to

Keyboard shortcuts

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