Documentation
¶
Overview ¶
Go ddfplus API
Copyright 2019 Barchart.com, Inc. All rights reserved.
This Source Code Form is subject to the terms of the GNU license available at https://github.com/barchart/go-ddfplus-api/blob/master/LICENSE.
Go ddfplus API ¶
Copyright 2019 Barchart.com, Inc. All rights reserved.
This Source Code Form is subject to the terms of the GNU license available at https://github.com/barchart/go-ddfplus-api/blob/master/LICENSE.
Go ddfplus API ¶
Copyright 2019 Barchart.com, Inc. All rights reserved.
This Source Code Form is subject to the terms of the GNU license available at https://github.com/barchart/go-ddfplus-api/blob/master/LICENSE.
Go ddfplus API ¶
Copyright 2019 Barchart.com, Inc. All rights reserved.
This Source Code Form is subject to the terms of the GNU license available at https://github.com/barchart/go-ddfplus-api/blob/master/LICENSE.
Go ddfplus API ¶
Copyright 2019 Barchart.com, Inc. All rights reserved.
This Source Code Form is subject to the terms of the GNU license available at https://github.com/barchart/go-ddfplus-api/blob/master/LICENSE.
Go ddfplus API ¶
Copyright 2019 Barchart.com, Inc. All rights reserved.
This Source Code Form is subject to the terms of the GNU license available at https://github.com/barchart/go-ddfplus-api/blob/master/LICENSE.
Go ddfplus API ¶
Copyright 2019 Barchart.com, Inc. All rights reserved.
This Source Code Form is subject to the terms of the GNU license available at https://github.com/barchart/go-ddfplus-api/blob/master/LICENSE.
Index ¶
- Constants
- func ParseFloat(s string, bc string) (float64, error)
- func ParseTimestamp(ba []byte, etxpos int) (time.Time, error)
- type Connection
- type Credentials
- type DB
- type DDFMessageInfo
- type Message
- type MessageBidAsk
- type MessageRefresh
- type MessageTimestamp
- type MessageTrade
- type MessageType
- type Quote
- type Symbol
- type SymbolType
- type UserSettings
Constants ¶
const (
JerqVersion = 4
)
const UserSettingsURL = "http://www.ddfplus.com/json/usersettings/"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(credentials *Credentials) (*Connection, error)
func (*Connection) RegisterMarketUpdate ¶
func (c *Connection) RegisterMarketUpdate(symbols []string, ch chan Message)
func (*Connection) RegisterMarketUpdateAll ¶
func (c *Connection) RegisterMarketUpdateAll(ch chan Message)
func (*Connection) RegisterTimestamp ¶
func (c *Connection) RegisterTimestamp(ch chan MessageTimestamp)
func (*Connection) Server ¶
func (c *Connection) Server()
func (*Connection) Start ¶
func (c *Connection) Start()
type Credentials ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Connect ¶
func (db *DB) Connect(conn *Connection)
type DDFMessageInfo ¶
type Message ¶
type Message interface {
Type() MessageType
}
type MessageBidAsk ¶
type MessageBidAsk struct {
Symbol string
Info DDFMessageInfo
Bid float64
BidSize int64
Ask float64
AskSize int64
Timestamp time.Time
}
func (MessageBidAsk) Type ¶
func (m MessageBidAsk) Type() MessageType
type MessageRefresh ¶
type MessageRefresh struct {
Symbol string
Name string
Exchange string
BaseCode string
PointValue float64
TickIncrement int
DDFExchange string
LastUpdate time.Time
Bid float64
BidSize int64
Ask float64
AskSize int64
CurrentSession struct {
Day string
Session string
Timestamp time.Time
Open float64
High float64
Low float64
Last float64
Previous float64
Settlement float64
TradeSize int64
Volume int64
OpenInterest int64
NumTrades int64
PriceVolume float64
TradeTime time.Time
Ticks string
}
PreviousSession struct {
Day string
Session string
Timestamp time.Time
Open float64
High float64
Low float64
Last float64
Previous float64
Settlement float64
TradeSize int64
Volume int64
OpenInterest int64
NumTrades int64
PriceVolume float64
TradeTime time.Time
Ticks string
}
}
func (MessageRefresh) Type ¶
func (m MessageRefresh) Type() MessageType
type MessageTimestamp ¶
func (MessageTimestamp) Type ¶
func (m MessageTimestamp) Type() MessageType
type MessageTrade ¶
type MessageTrade struct {
Symbol string
Info DDFMessageInfo
Trade float64
TradeSize int64
Timestamp time.Time
}
func (MessageTrade) Type ¶
func (m MessageTrade) Type() MessageType
type Quote ¶
type Quote struct {
Symbol string `json:"symbol"`
Info struct {
Name string `json:"name"`
Exchange string `json:"exchange"`
DDFExchange string `json:"ddfexchange"`
BaseCode string `json:"basecode"`
TickIncrement int `json:"tickincrement"`
PointValue float64 `json:"pointvalue"`
} `json:":info"`
Data struct {
CurrentSession struct {
Bid float64 `json:"bid"`
BidSize int64 `json:"bidsize"`
Ask float64 `json:"ask"`
AskSize int64 `json:"asksize"`
Open float64 `json:"open"`
High float64 `json:"high"`
Low float64 `json:"low"`
Last float64 `json:"last"`
LastSize int64 `json:"lastsize"`
TradeTime time.Time `json:"tradetime"`
Timestamp time.Time `json:timestamp"`
} `json:"current"`
} `json:"data"`
LastUpdate time.Time `json:"lastupdate"`
}
type Symbol ¶
func ParseSymbol ¶
type SymbolType ¶
type SymbolType int
const ( Unknown SymbolType = 0 Future SymbolType = 1 FutureOption SymbolType = 2 )
type UserSettings ¶
type UserSettings struct {
Login struct {
Username string `json:"username"`
Status bool `json:"status"`
Credentials bool `json:"credentials"`
} `json:"login"`
Service struct {
Id string `json:"id"`
MaxSymbols int `json:"maxsymbols"`
} `json:"service"`
Exchanges []string `json:"exchanges"`
Servers struct {
Stream []string `json:"stream"`
WSS []string `json:"wss"`
Historical []string `json:"historical"`
Extras []string `json:"extras"`
News []string `json:"news"`
} `json:"servers"`
}
func GetUserSettings ¶
func GetUserSettings(credentials *Credentials) (UserSettings, error)