client

package
v0.0.0-...-514d7d6 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FugleAPIBestPrice

type FugleAPIBestPrice struct {
	Price  decimal.Decimal `json:"price"`
	Unit   decimal.Decimal `json:"unit"`
	Volume decimal.Decimal `json:"volume"`
}

type FugleAPIChartPrice

type FugleAPIChartPrice struct {
	Open   decimal.Decimal `json:"open"`
	High   decimal.Decimal `json:"high"`
	Low    decimal.Decimal `json:"low"`
	Close  decimal.Decimal `json:"close"`
	Volume decimal.Decimal `json:"volume"`
	Unit   decimal.Decimal `json:"unit"`
}

type FugleAPIData

type FugleAPIData struct {
	Info   FugleAPIInfo                  `json:"info"`
	Chart  map[string]FugleAPIChartPrice `json:"chart"`
	Quote  FugleAPIQuote                 `json:"quote"`
	Meta   FugleAPIMeta                  `json:"meta"`
	Dealts []FugleAPIDealts              `json:"dealts"`
}

type FugleAPIDealts

type FugleAPIDealts struct {
	At     string          `json:"at"`
	Price  decimal.Decimal `json:"price"`
	Unit   decimal.Decimal `json:"unit"`
	Serial decimal.Decimal `json:"serial"`
}

type FugleAPIInfo

type FugleAPIInfo struct {
	Date          string `json:"date"`
	Mode          string `json:"mode"`
	SymbolID      string `json:"symbolId"`
	CountryCode   string `json:"countryCode"`
	Timezone      string `json:"timeZone"`
	LastUpdatedAt string `json:"lastUpdatedAt"`
}

type FugleAPIMeta

type FugleAPIMeta struct {
	Isindex                bool            `json:"isIndex"`
	Namezhtw               string          `json:"nameZhTw"`
	Industryzhtw           string          `json:"industryZhTw"`
	Pricereference         decimal.Decimal `json:"priceReference"`
	Pricehighlimit         decimal.Decimal `json:"priceHighLimit"`
	Pricelowlimit          decimal.Decimal `json:"priceLowLimit"`
	Candaybuysell          bool            `json:"canDayBuySell"`
	Candaysellbuy          bool            `json:"canDaySellBuy"`
	Canshortmargin         bool            `json:"canShortMargin"`
	Canshortlend           bool            `json:"canShortLend"`
	Volumeperunit          int             `json:"volumePerUnit"`
	Currency               string          `json:"currency"`
	Isterminated           bool            `json:"isTerminated"`
	Issuspended            bool            `json:"isSuspended"`
	Iswarrant              bool            `json:"isWarrant"`
	Typezhtw               string          `json:"typeZhTw"`
	Abnormal               string          `json:"abnormal"`
	IsUnusuallyRecommended bool            `json:"isUnusuallyRecommended"`
}

type FugleAPIOrder

type FugleAPIOrder struct {
	At       string              `json:"at"`
	Bestbids []FugleAPIBestPrice `json:"bestBids"`
	Bestasks []FugleAPIBestPrice `json:"bestAsks"`
}

type FugleAPIQuote

type FugleAPIQuote struct {
	Iscurbing      bool               `json:"isCurbing"`
	Iscurbingrise  bool               `json:"isCurbingRise"`
	Iscurbingfall  bool               `json:"isCurbingFall"`
	Istrial        bool               `json:"isTrial"`
	Isopendelayed  bool               `json:"isOpenDelayed"`
	Isclosedelayed bool               `json:"isCloseDelayed"`
	Ishalting      bool               `json:"isHalting"`
	Isclosed       bool               `json:"isClosed"`
	Total          FugleAPITotal      `json:"total"`
	Trial          FugleAPITrial      `json:"trial"`
	Trade          FugleAPITrade      `json:"trade"`
	Order          FugleAPIOrder      `json:"order"`
	PriceHigh      FugleAPIQuotePrice `json:"priceHigh"`
	PriceLow       FugleAPIQuotePrice `json:"priceLow"`
	PriceOpen      FugleAPIQuotePrice `json:"priceOpen"`
}

type FugleAPIQuotePrice

type FugleAPIQuotePrice struct {
	Price decimal.Decimal `json:"price"`
	At    string          `json:"at"`
}

type FugleAPIResponse

type FugleAPIResponse struct {
	APIVersion string       `json:"api_version"`
	StatusCode int          `json:"status_code"`
	Data       FugleAPIData `json:"data"`
}

func (*FugleAPIResponse) PrettyPrint

func (resp *FugleAPIResponse) PrettyPrint()

type FugleAPITotal

type FugleAPITotal struct {
	At     string          `json:"at"`
	Unit   decimal.Decimal `json:"unit"`
	Volume decimal.Decimal `json:"volume"`
}

type FugleAPITrade

type FugleAPITrade struct {
	At     string          `json:"at"`
	Price  decimal.Decimal `json:"price"`
	Unit   decimal.Decimal `json:"unit"`
	Volume decimal.Decimal `json:"volume"`
	Serial decimal.Decimal `json:"serial"`
}

type FugleAPITrial

type FugleAPITrial struct {
	At     string          `json:"at"`
	Price  decimal.Decimal `json:"price"`
	Unit   decimal.Decimal `json:"unit"`
	Volume decimal.Decimal `json:"volume"`
}

type FugleClient

type FugleClient interface {
	Chart(symbolID string, oddLot bool) (FugleAPIResponse, error)
	Quote(symbolID string, oddLot bool) (FugleAPIResponse, error)
	Meta(symbolID string, oddLot bool) (FugleAPIResponse, error)
	Dealts(symbolID string, oddLot bool) (FugleAPIResponse, error)
}

func NewFugleClient

func NewFugleClient(opts ...FugleClientOption) (FugleClient, error)

type FugleClientOption

type FugleClientOption interface {
	// contains filtered or unexported methods
}

func ConfigOption

func ConfigOption(conf config.ConfigSet) FugleClientOption

Jump to

Keyboard shortcuts

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