{"modulePath":"github.com/QuantProcessing/exchanges","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package data\n\n## Functions\n\n```go\nfunc EventTime(event model.MarketEvent) time.Time\n```\n\n## Types\n\n```go\ntype BarAggregator struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewBarAggregator(barType model.BarType) (*BarAggregator, error)\n```\n\n```go\nfunc (a *BarAggregator) Flush() (model.Bar, bool, error)\n```\n\n```go\nfunc (a *BarAggregator) Update(event model.MarketEvent) (model.Bar, bool, error)\n```\n\n```go\ntype Catalog interface {\n\tWrite(context.Context, ...model.MarketEvent) error\n\tQuery(context.Context, model.DataRequest) (model.DataResponse, error)\n}\n```\n\n```go\ntype ClientHealth struct {\n\tVenue    model.Venue\n\tClientID string\n\tHealth   venue.DataHealth\n\tStale    bool\n}\n```\n\n```go\ntype Config struct {\n\tBus             *bus.Bus\n\tCache           *cache.Cache\n\tCatalog         Catalog\n\tReconnectPolicy RetryPolicy\n\tStaleAfter      time.Duration\n}\n```\n\n```go\ntype Engine struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewEngine(cfg Config) *Engine\n```\n\n```go\nfunc (e *Engine) AddBarAggregation(barType model.BarType) error\n```\n\n```go\nfunc (e *Engine) AddClient(client venue.DataClient) error\n```\n\n```go\nfunc (e *Engine) Events() \u003c-chan model.MarketEvent\n```\n\n```go\nfunc (e *Engine) Health() Health\n```\n\n```go\nfunc (e *Engine) Request(ctx context.Context, request model.DataRequest) (model.DataResponse, error)\n```\n\n```go\nfunc (e *Engine) Start(ctx context.Context) error\n```\n\n```go\nfunc (e *Engine) Stop(ctx context.Context) error\n```\n\n```go\nfunc (e *Engine) Subscribe(ctx context.Context, sub model.SubscribeMarketData) error\n```\n\n```go\nfunc (e *Engine) Unsubscribe(ctx context.Context, sub model.SubscribeMarketData) error\n```\n\n```go\ntype Health struct {\n\tRunning        bool\n\tClients        int\n\tSubscriptions  int\n\tEvents         int64\n\tRequests       int64\n\tAggregatedBars int64\n\tStaleClients   int\n\tLastEventTime  time.Time\n\tLastError      error\n\tClientsHealth  []ClientHealth\n}\n```\n\n```go\ntype MemoryCatalog struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewMemoryCatalog(events ...model.MarketEvent) *MemoryCatalog\n```\n\n```go\nfunc (c *MemoryCatalog) Events(context.Context) ([]model.MarketEvent, error)\n```\n\n```go\nfunc (c *MemoryCatalog) Query(_ context.Context, request model.DataRequest) (model.DataResponse, error)\n```\n\n```go\nfunc (c *MemoryCatalog) Write(_ context.Context, events ...model.MarketEvent) error\n```\n\n```go\ntype ReplayCatalog interface {\n\tCatalog\n\tEvents(context.Context) ([]model.MarketEvent, error)\n}\n```\n\n```go\ntype RetryPolicy struct {\n\tMaxAttempts int\n\tBackoff     time.Duration\n}\n```\n\n","path":"github.com/QuantProcessing/exchanges/data","name":"data","synopsis":"","isRedistributable":true}
