Documentation ¶
Overview ¶
Package mtgox provides a streaming implementation of Mt. Gox's bitcoin trading API.
Index ¶
- type Config
- type Depth
- type EpochTime
- type Info
- type Order
- type Rate
- type SimpleTime
- type StreamingApi
- func (api *StreamingApi) Close() error
- func (api *StreamingApi) HandleErrors(f func(error))
- func (api *StreamingApi) RequestInfo() (c chan Info)
- func (api *StreamingApi) RequestOrders() (c chan []Order)
- func (api *StreamingApi) Start()
- func (api *StreamingApi) SubmitOrder(typ string, amount, price int64) chan []Order
- type Ticker
- type Trade
- type Value
- type Wallet
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpochTime ¶
func (*EpochTime) UnmarshalJSON ¶
type SimpleTime ¶
func (*SimpleTime) UnmarshalJSON ¶
func (t *SimpleTime) UnmarshalJSON(b []byte) error
type StreamingApi ¶
type StreamingApi struct { Errors chan error Ticker chan Ticker Info chan Info Depth chan Depth Trade chan Trade Orders chan []Order // contains filtered or unexported fields }
Example ¶
gox, err := NewFromConfig(os.ExpandEnv("$MTGOX_CONFIG")) gox.Start() if err != nil { panic(err) } tickers := gox.Ticker if err != nil { panic(err) } go func() { for ticker := range tickers { fmt.Println("Got ticker", ticker) } }() orderchan := gox.SubmitOrder("bid", 100000000, 10000) // Both are in _int notation order := <-orderchan fmt.Println("Yay submitted an order!", order)
Output:
func NewFromConfig ¶
func NewFromConfig(cfgfile string) (*StreamingApi, error)
func (*StreamingApi) Close ¶
func (api *StreamingApi) Close() error
func (*StreamingApi) HandleErrors ¶
func (api *StreamingApi) HandleErrors(f func(error))
func (*StreamingApi) RequestInfo ¶
func (api *StreamingApi) RequestInfo() (c chan Info)
func (*StreamingApi) RequestOrders ¶
func (api *StreamingApi) RequestOrders() (c chan []Order)
func (*StreamingApi) Start ¶
func (api *StreamingApi) Start()
func (*StreamingApi) SubmitOrder ¶
func (api *StreamingApi) SubmitOrder(typ string, amount, price int64) chan []Order
type Ticker ¶
type Ticker struct { Vol Value // Volume Item string High Value //Highest value Low Value // Lowest Value Last Value // == Last_local Last_local Value // Last trade in auxilary currency Last_all Value // Last trade converted to auxilary currency Last_orig Value // Last trade in any currency Buy Value Sell Value VWap Value // Volume weighted average price Avg Value // Averaged price Now EpochTime `json:",string"` }
Click to show internal directories.
Click to hide internal directories.