Documentation ¶
Index ¶
- Constants
- type ClientConfig
- type Price
- type Quote
- type QuoteParams
- type SpiceClient
- func (c *SpiceClient) Close() error
- func (c *SpiceClient) FireQuery(ctx context.Context, sql string) (array.RecordReader, error)
- func (c *SpiceClient) GetHistoricalPrices(ctx context.Context, pairs []string, params *QuoteParams) (map[string][]Price, error)
- func (c *SpiceClient) GetPrices(ctx context.Context, pairs []string) (map[string]Quote, error)
- func (c *SpiceClient) Init(apiKey string) error
- func (c *SpiceClient) Query(ctx context.Context, sql string) (array.RecordReader, error)
- func (c *SpiceClient) SetMaxRetries(maxRetries uint)
Constants ¶
const (
MAX_MESSAGE_SIZE_BYTES = 100 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { HttpUrl string `json:"http_url,omitempty"` FlightUrl string `json:"flight_url,omitempty"` FirecacheUrl string `json:"firecache_url,omitempty"` }
func LoadConfig ¶
func LoadConfig() ClientConfig
type Quote ¶
type Quote struct { Prices map[string]string `mapstructure:"prices,omitempty" json:"prices,omitempty"` MinPrice string `mapstructure:"minPrice,omitempty" json:"minPrice,omitempty"` MaxPrice string `mapstructure:"maxPrice,omitempty" json:"maxPrice,omitempty"` MeanPrice string `mapstructure:"avePrice,omitempty" json:"avePrice,omitempty"` }
type QuoteParams ¶
type SpiceClient ¶
type SpiceClient struct {
// contains filtered or unexported fields
}
SpiceClient is a client for Spice.ai - Data and AI infrastructure for web3 https://spice.ai For documentation visit https://docs.spice.ai/sdks/go-sdk
func NewSpiceClientWithAddress ¶
func NewSpiceClientWithAddress(flightAddress string, firecacheAddress string) *SpiceClient
func (*SpiceClient) Close ¶
func (c *SpiceClient) Close() error
Close closes the SpiceClient and cleans up resources
func (*SpiceClient) FireQuery ¶
func (c *SpiceClient) FireQuery(ctx context.Context, sql string) (array.RecordReader, error)
FireQuery executes a query against Spice.ai Firecache and returns a Apache Arrow RecordReader For more information on Apache Arrow RecordReader visit https://godoc.org/github.com/apache/arrow/go/arrow/array#RecordReader
func (*SpiceClient) GetHistoricalPrices ¶
func (c *SpiceClient) GetHistoricalPrices(ctx context.Context, pairs []string, params *QuoteParams) (map[string][]Price, error)
func (*SpiceClient) Init ¶
func (c *SpiceClient) Init(apiKey string) error
Init initializes the SpiceClient
func (*SpiceClient) Query ¶
func (c *SpiceClient) Query(ctx context.Context, sql string) (array.RecordReader, error)
Query executes a query against Spice.ai and returns a Apache Arrow RecordReader For more information on Apache Arrow RecordReader visit https://godoc.org/github.com/apache/arrow/go/arrow/array#RecordReader
func (*SpiceClient) SetMaxRetries ¶
func (c *SpiceClient) SetMaxRetries(maxRetries uint)
Sets the maximum number of times to retry Query and FireQuery calls. The default is 3. Setting to 0 will disable retries.