Documentation
¶
Overview ¶
TODO: Renaming of stuff
Index ¶
- Variables
- func BindFeedClient(ps remote.PubSub, feedUri string, fc FeedClient) error
- type Callback
- type CmdWriter
- type ConnWrap
- type FeedClient
- type FeedDaemon
- type FeedState
- func (fs *FeedState) AddSubscription(cmd *feedmodel.FeedCmd) (res string)
- func (fs *FeedState) OnConnect(w CmdWriter, ft feedmodel.FeedType)
- func (fs *FeedState) OnError(err error, ft feedmodel.FeedType)
- func (fs *FeedState) OnMessage(msg *feedmodel.FeedMsg, ft feedmodel.FeedType)
- func (fs *FeedState) SetInfo(key, val string) *FeedState
- type FeedSubscriptionKey
- type SessionProvider
Constants ¶
This section is empty.
Variables ¶
var DefaultTLS *tls.Config
Set this static variable if you need special TLS config. Used in tests for example.
Functions ¶
func BindFeedClient ¶
func BindFeedClient(ps remote.PubSub, feedUri string, fc FeedClient) error
And a new func to bind the traditional way
Types ¶
type FeedClient ¶
Convenience function to recive feed messages
func FeedSorter ¶
func FeedSorter(fc FeedClient) (ret FeedClient)
FeedSorter will try and get out of order messages back in order. This can occure if you send the feed to a event queue. Requires that SeqId is set. Notice, we are not thread safe. If needed, add a FeedClient in between that only uses one go rutine to send. To flush cached data, send a nil. (For scripts that backtests, to make sure all is delivered)
func FeedSorterDelayedIfNotSeqId ¶
func FeedSorterDelayedIfNotSeqId(delayMillis int64, fc FeedClient) (ret FeedClient)
FeedSorterDelayedIfNotSeqId: A MUCH slower version of FeedSorter. Will delay messages by X millis, and then sort and deligate. Use mainly for historicaol data where SeqId might not exist, or for some reason the source might be scrambled. For a realtime experience, use normal FeedSorter if your messages are out of order.
type FeedDaemon ¶
type FeedDaemon struct {
// contains filtered or unexported fields
}
This object should connect to the feeds, keep them alive, and keep state
func NewFeedDaemon ¶
func NewFeedDaemon(privSess, pubSess SessionProvider, cb Callback) (fd *FeedDaemon, err error)
func NewFeedDaemonAPI ¶
func NewFeedDaemonAPI(api *api.ApiClient) (fd *FeedDaemon, err error)
This is not the preferred constuctor.
func (*FeedDaemon) Close ¶
func (fd *FeedDaemon) Close() error
func (*FeedDaemon) KillSockets ¶
func (fd *FeedDaemon) KillSockets() (string, error)
ONLY for testing....
func (*FeedDaemon) Subscribe ¶
func (fd *FeedDaemon) Subscribe(typ, ident, market string) error
type FeedState ¶
type FeedState struct { api.RequestCommandTransport // contains filtered or unexported fields }
func NewFeedTransport ¶
func NewFeedTransport(dstChan remote.StreamTopicChannel) *FeedState
func (*FeedState) AddSubscription ¶
type FeedSubscriptionKey ¶
A representation of the subscription. Can generate the proper types depending on data
type SessionProvider ¶
func MakePrivateSessionProvider ¶
func MakePrivateSessionProvider(api *api.ApiClient) SessionProvider
func MakePublicSessionProvider ¶
func MakePublicSessionProvider(api *api.ApiClient) SessionProvider