Documentation ¶
Index ¶
- Variables
- func Decode(data []byte, v ...interface{}) error
- func DecodeBytes(data []byte) ([]byte, []byte, error)
- func DecodeSigned16(data []byte) (int16, []byte, error)
- func DecodeSigned32(data []byte) (int32, []byte, error)
- func DecodeSigned64(data []byte) (int64, []byte, error)
- func DecodeSigned8(data []byte) (int8, []byte, error)
- func DecodeString(data []byte) (string, []byte, error)
- func DecodeUnsigned16(data []byte) (uint16, []byte, error)
- func DecodeUnsigned32(data []byte) (uint32, []byte, error)
- func DecodeUnsigned64(data []byte) (uint64, []byte, error)
- func DecodeUnsigned8(data []byte) (uint8, []byte, error)
- func Encode(v ...interface{}) ([]byte, error)
- func EncodeBytes(v []byte) []byte
- func EncodeSigned16(v int16) []byte
- func EncodeSigned32(v int32) []byte
- func EncodeSigned64(v int64) []byte
- func EncodeSigned8(v int8) []byte
- func EncodeString(v string) []byte
- func EncodeUnsigned16(v uint16) []byte
- func EncodeUnsigned32(v uint32) []byte
- func EncodeUnsigned64(v uint64) []byte
- func EncodeUnsigned8(v uint8) []byte
- func GetSchema(v interface{}) (string, error)
- func MustDecode(data []byte, v ...interface{})
- func MustEncode(v ...interface{}) []byte
- func MustGetSchema(v interface{}) string
- type APILayerResponse
- type BandResponse
- type BandResult
- type BinancePrice
- type FxResponse
- type LunaPrice
- type LunaPriceCallData
- type OrderBook
- type PacketResult
- type PriceService
- type PriceWithTimestamp
- type RawReports
- type RawRequests
- type RequestPacketData
- type ResponsePacketData
- type Result
- type Ticker_bithumb
- type Trade
- type TradeHistory
Constants ¶
This section is empty.
Variables ¶
var ( MULTIPLIER = uint64(1000000000) LUNA_PRICE_CALLDATA = LunaPriceCallData{Multiplier: MULTIPLIER} LUNA_PRICE_END_POINT = fmt.Sprintf("/oracle/v1/request_search?oid=13&calldata=%x&min_count=3&ask_count=4", LUNA_PRICE_CALLDATA.toBytes()) )
Functions ¶
func DecodeBytes ¶
DecodeBytes decodes the input bytes and returns bytes result and the remaining bytes.
func DecodeSigned16 ¶
DecodeSigned16 decodes the input bytes into `uint64` and returns the remaining bytes.
func DecodeSigned32 ¶
DecodeSigned32 decodes the input bytes into `uint64` and returns the remaining bytes.
func DecodeSigned64 ¶
DecodeSigned64 decodes the input bytes into `uint64` and returns the remaining bytes.
func DecodeSigned8 ¶
DecodeSigned8 decodes the input bytes into `uint64` and returns the remaining bytes.
func DecodeString ¶
DecodeString decodes the input bytes and returns string result and the remaining bytes.
func DecodeUnsigned16 ¶
DecodeUnsigned16 decodes the input bytes into `uint16` and returns the remaining bytes.
func DecodeUnsigned32 ¶
DecodeUnsigned32 decodes the input bytes into `uint32` and returns the remaining bytes.
func DecodeUnsigned64 ¶
DecodeUnsigned64 decodes the input bytes into `uint64` and returns the remaining bytes.
func DecodeUnsigned8 ¶
DecodeUnsigned8 decodes the input bytes into `uint8` and returns the remaining bytes.
func EncodeBytes ¶
EncodeBytes takes a `[]byte` variable and encodes it into a byte array
func EncodeSigned16 ¶
EncodeSigned16 takes an `int16` variable and encodes it into a byte array
func EncodeSigned32 ¶
EncodeSigned32 takes an `int32` variable and encodes it into a byte array
func EncodeSigned64 ¶
EncodeSigned64 takes an `int64` variable and encodes it into a byte array
func EncodeSigned8 ¶
EncodeSigned8 takes an `int8` variable and encodes it into a byte array
func EncodeString ¶
EncodeString takes a `string` variable and encodes it into a byte array
func EncodeUnsigned16 ¶
EncodeUnsigned16 takes an `uint16` variable and encodes it into a byte array
func EncodeUnsigned32 ¶
EncodeUnsigned32 takes an `uint32` variable and encodes it into a byte array
func EncodeUnsigned64 ¶
EncodeUnsigned64 takes an `uint64` variable and encodes it into a byte array
func EncodeUnsigned8 ¶
EncodeUnsigned8 takes an `uint8` variable and encodes it into a byte array
func MustDecode ¶
func MustDecode(data []byte, v ...interface{})
MustDecode uses obi encoding scheme to decode the given input. Panics on error.
func MustEncode ¶
func MustEncode(v ...interface{}) []byte
MustEncode uses obi encoding scheme to encode the given input into bytes. Panics on error.
func MustGetSchema ¶
func MustGetSchema(v interface{}) string
MustGetSchema returns the compact OBI individual schema of the given value. Panics on error.
Types ¶
type APILayerResponse ¶
type APILayerResponse struct { Success bool `json:"success"` Terms string `json:"terms"` Privacy string `json:"privacy"` Timestamp int64 `json:"timestamp"` Source string `json:"source"` Quotes map[string]float64 `json:"quotes"` }
APILayerResponse response body from currencylayer
type BandResponse ¶
type BandResponse struct {
Request BandResult `json:"request"`
}
type BandResult ¶
type BandResult struct {
Result PacketResult `json:"result"`
}
type BinancePrice ¶
BinancePrice response from binance
type FxResponse ¶
type FxResponse struct {
Result []Result `json:"price_results"`
}
type LunaPriceCallData ¶
type LunaPriceCallData struct {
Multiplier uint64
}
type PacketResult ¶
type PacketResult struct { ClientID string `json:"client_id"` OracleScriptID int64 `json:"oracle_script_id,string"` Calldata []byte `json:"calldata"` AskCount uint64 `json:"ask_count,string"` MinCount uint64 `json:"min_count,string"` RequestID int64 `json:"request_id,string"` AnsCount uint64 `json:"ans_count,string"` RequestTime int64 `json:"request_time,string"` ResolveTime int64 `json:"resolve_time,string"` ResolveStatus string `json:"resolve_status"` Result []byte `json:"result,string"` }
type PriceService ¶
type PriceService struct { service.BaseService // contains filtered or unexported fields }
func NewPriceService ¶
func NewPriceService() *PriceService
func (*PriceService) OnStart ¶
func (ps *PriceService) OnStart() error
type PriceWithTimestamp ¶
type RawReports ¶
type RawRequests ¶
type RequestPacketData ¶
type ResponsePacketData ¶
type ResponsePacketData struct { ClientID string `json:"client_id"` RequestID uint64 `json:"request_id,string"` AnsCount uint64 `json:"ans_count,string"` RequestTime uint64 `json:"request_time,string"` ResolveTime uint64 `json:"resolve_time,string"` ResolveStatus uint8 `json:"resolve_status"` Result []byte `json:"result,string"` }
type Ticker_bithumb ¶
type Ticker_bithumb struct { Data struct { Closing_price string `json:"closing_price"` Date string `json:"date"` } }
for bithumn
type Trade ¶
type Trade struct { Timestamp uint64 `json:"timestamp"` Price string `json:"price"` Volume string `json:"volume"` IsSellerMaker bool `json:"is_seller_maker"` }
Trade response from coinone
type TradeHistory ¶
type TradeHistory struct {
Trades []Trade `json:"trades"`
}
TradeHistory response from coinone