Documentation
¶
Index ¶
- Constants
- Variables
- func NormalizeFeedID(id string) (string, error)
- type Candle
- type CandlesQuery
- type Channel
- type Client
- func (c *Client) Candles(ctx context.Context, q CandlesQuery) ([]Candle, error)
- func (c *Client) FeedIDs(ctx context.Context, opts FeedIDsOptions) (FeedIDMap, error)
- func (c *Client) Feeds(ctx context.Context, category string) ([]Feed, error)
- func (c *Client) LatestPrices(ctx context.Context, ids []string, q PriceQuery) ([]PriceUpdate, error)
- func (c *Client) PriceFeed(ctx context.Context, id string) (FeedMetadata, error)
- func (c *Client) PriceFeeds(ctx context.Context, q PriceFeedsQuery) ([]FeedMetadata, error)
- func (c *Client) PricesAt(ctx context.Context, publishTime int64, ids []string, q PriceQuery) ([]PriceUpdate, error)
- func (c *Client) PricesInInterval(ctx context.Context, publishTime int64, intervalSeconds int, ids []string, ...) ([]PriceUpdate, error)
- func (c *Client) Status(ctx context.Context, opts ...StatusOptions) (StatusReport, error)
- func (c *Client) Subscribe(ctx context.Context, ids []string, opts SubscribeOptions) (*Subscription, error)
- type ConnectionState
- type Feed
- type FeedHealth
- type FeedIDEntry
- type FeedIDMap
- type FeedIDsOptions
- type FeedMetadata
- type FeedStatus
- type HTTPError
- type IntervalQuery
- type LiveValue
- type Options
- type Price
- type PriceFeedsQuery
- type PriceQuery
- type PriceUpdate
- type Problem
- type ServerError
- type Stats
- type StatusOptions
- type StatusReport
- type SubscribeOptions
- type Subscription
- type SubscriptionError
- type Transport
- type UpdateMetadata
- type ValidationError
Constants ¶
View Source
const ( DefaultBaseURL = "https://astra.preview.avee.tech" MaxIntervalSeconds = 60 FeedIDsPerRequest = MaxIDsPerURL )
View Source
const ( MaxIDsPerRequest = 500 MaxIDsPerURL = 200 MaxHistoricalFeeds = 100 )
View Source
const ( MinExpo = -32 MaxExpo = 32 MaxScaleDecimals = 77 )
Variables ¶
View Source
var ErrTimeout = errors.New("astra: timeout")
Functions ¶
func NormalizeFeedID ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) LatestPrices ¶
func (c *Client) LatestPrices(ctx context.Context, ids []string, q PriceQuery) ([]PriceUpdate, error)
func (*Client) PriceFeeds ¶
func (c *Client) PriceFeeds(ctx context.Context, q PriceFeedsQuery) ([]FeedMetadata, error)
func (*Client) PricesAt ¶
func (c *Client) PricesAt(ctx context.Context, publishTime int64, ids []string, q PriceQuery) ([]PriceUpdate, error)
func (*Client) PricesInInterval ¶
func (c *Client) PricesInInterval(ctx context.Context, publishTime int64, intervalSeconds int, ids []string, q IntervalQuery) ([]PriceUpdate, error)
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context, opts ...StatusOptions) (StatusReport, error)
func (*Client) Subscribe ¶
func (c *Client) Subscribe(ctx context.Context, ids []string, opts SubscribeOptions) (*Subscription, error)
type ConnectionState ¶
type ConnectionState string
const ( StateConnecting ConnectionState = "connecting" StateOpen ConnectionState = "open" StateReconnecting ConnectionState = "reconnecting" StateClosed ConnectionState = "closed" )
type FeedHealth ¶
type FeedIDEntry ¶
type FeedIDMap ¶
type FeedIDMap struct {
Items []FeedIDEntry
Missing []string
}
type FeedIDsOptions ¶
type FeedMetadata ¶
type FeedStatus ¶
type FeedStatus string
const ( StatusTrading FeedStatus = "trading" StatusDegraded FeedStatus = "degraded" StatusMarketClosed FeedStatus = "market_closed" StatusReference FeedStatus = "reference" StatusNoData FeedStatus = "no_data" )
type HTTPError ¶
type IntervalQuery ¶
type Price ¶
func (Price) ConfFloat64 ¶
type PriceFeedsQuery ¶
type PriceQuery ¶
type PriceQuery struct {
IgnoreInvalid bool
}
type PriceUpdate ¶
type PriceUpdate struct {
Metadata *UpdateMetadata
ID string
Price Price
EMAPrice Price
}
type ServerError ¶
type ServerError struct {
Reason string
}
func (*ServerError) Error ¶
func (e *ServerError) Error() string
type StatusOptions ¶
type StatusOptions struct {
Feed string
}
type StatusReport ¶
type StatusReport struct {
Feeds []FeedHealth
Ready bool
}
type SubscribeOptions ¶
type SubscribeOptions struct {
OnError func(error)
OnStateChange func(ConnectionState)
Transport Transport
Channel Channel
IdleTimeout time.Duration
ReconnectBaseDelay time.Duration
ReconnectMaxDelay time.Duration
StableAfter time.Duration
MaxMessageBytes int64
IgnoreInvalid bool
BenchmarksOnly bool
}
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Close ¶
func (s *Subscription) Close() error
func (*Subscription) Done ¶
func (s *Subscription) Done() <-chan struct{}
func (*Subscription) Err ¶
func (s *Subscription) Err() error
func (*Subscription) IDs ¶
func (s *Subscription) IDs() []string
func (*Subscription) State ¶
func (s *Subscription) State() ConnectionState
func (*Subscription) Stats ¶
func (s *Subscription) Stats() Stats
func (*Subscription) Updates ¶
func (s *Subscription) Updates() <-chan PriceUpdate
type SubscriptionError ¶
type SubscriptionError struct {
Reason string
}
func (*SubscriptionError) Error ¶
func (e *SubscriptionError) Error() string
type UpdateMetadata ¶
type ValidationError ¶
type ValidationError struct {
Reason string
}
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.