client

package
v0.0.0-...-2d0da97 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
	AccessKey string
	SecretKey string
}

func (*Client) Call

func (c *Client) Call(method, url string, v interface{}) (interface{}, error)

Call 은 업비트 API 서버로 요청을 보낸다. https://docs.upbit.com/docs/create-authorization-request

응답은 map[string]interface{}, []map[string]interface{} 중에 하나이므로 받아온 이후에는 변환이 필요하다.

배열을 전달할 때는 주의해야 한다. 구조체를 정의할때 필드에 대해 `url:,numbered" 옵션을 주어야 한다.

type QuotationClient

type QuotationClient struct {
	*http.Client
}

func (*QuotationClient) Call

func (qc *QuotationClient) Call(url string, v interface{}) (interface{}, error)

Call 은 업비트 API 서버로 요청을 보내되, Quotation API 에 한하여 보내도록 한다.

type WebsocketClient

type WebsocketClient struct {
	Ws   *websocket.Conn
	Data []map[string]interface{}
}

func NewWebsocketClient

func NewWebsocketClient(t string, codes []string, isOnlySnapshot, isOnlyRealtime bool) (*WebsocketClient, error)

Jump to

Keyboard shortcuts

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