Documentation
¶
Index ¶
- Constants
- 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) GetPrices(ctx context.Context, pair string, params *QuoteParams) (*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 QuoteParams ¶
type SpiceClient ¶
type SpiceClient struct {
// contains filtered or unexported fields
}
SpiceClient is a client for Spice.xyz - Data and AI infrastructure for web3 https://spice.xyz For documentation visit https://docs.spice.xyz/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.xyz 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) GetPrices ¶
func (c *SpiceClient) GetPrices(ctx context.Context, pair string, params *QuoteParams) (*Quote, 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.xyz 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 ¶ added in v2.2.3
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.