Documentation
¶
Overview ¶
Package ftxv1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Index ¶
- func NewGetCoinsRequest(server string) (*http.Request, error)
- func NewGetMarketsRequest(server string) (*http.Request, error)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type Coin
- type GetCoinsResponse
- type GetMarketsResponse
- type HttpRequestDoer
- type Market
- type RequestEditorFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetCoinsRequest ¶
NewGetCoinsRequest generates requests for GetCoins
Types ¶
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetMarkets ¶
type ClientInterface ¶
type ClientInterface interface { // GetCoins request GetCoins(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // GetMarkets request GetMarkets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetCoinsWithResponse ¶
func (c *ClientWithResponses) GetCoinsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCoinsResponse, error)
GetCoinsWithResponse request returning *GetCoinsResponse
func (*ClientWithResponses) GetMarketsWithResponse ¶
func (c *ClientWithResponses) GetMarketsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMarketsResponse, error)
GetMarketsWithResponse request returning *GetMarketsResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // GetCoins request GetCoinsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCoinsResponse, error) // GetMarkets request GetMarketsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMarketsResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Coin ¶
type Coin struct { Id string `json:"id"` Name string `json:"name"` AdditionalProperties map[string]interface{} `json:"-"` }
Coin defines model for coin.
func (Coin) Get ¶
Getter for additional properties for Coin. Returns the specified element and whether it was found
func (Coin) MarshalJSON ¶
Override default JSON handling for Coin to handle AdditionalProperties
func (*Coin) UnmarshalJSON ¶
Override default JSON handling for Coin to handle AdditionalProperties
type GetCoinsResponse ¶
type GetCoinsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { Result *[]Coin `json:"result,omitempty"` Success *bool `json:"success,omitempty"` } }
func ParseGetCoinsResponse ¶
func ParseGetCoinsResponse(rsp *http.Response) (*GetCoinsResponse, error)
ParseGetCoinsResponse parses an HTTP response from a GetCoinsWithResponse call
func (GetCoinsResponse) Status ¶
func (r GetCoinsResponse) Status() string
Status returns HTTPResponse.Status
func (GetCoinsResponse) StatusCode ¶
func (r GetCoinsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetMarketsResponse ¶
type GetMarketsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { Result *[]Market `json:"result,omitempty"` Success *bool `json:"success,omitempty"` } }
func ParseGetMarketsResponse ¶
func ParseGetMarketsResponse(rsp *http.Response) (*GetMarketsResponse, error)
ParseGetMarketsResponse parses an HTTP response from a GetMarketsWithResponse call
func (GetMarketsResponse) Status ¶
func (r GetMarketsResponse) Status() string
Status returns HTTPResponse.Status
func (GetMarketsResponse) StatusCode ¶
func (r GetMarketsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Market ¶
type Market struct { Ask float64 `json:"ask"` BaseCurrency string `json:"baseCurrency"` Bid float64 `json:"bid"` Change1h float64 `json:"change1h"` Change24h float64 `json:"change24h"` ChangeBod float64 `json:"changeBod"` Enabled bool `json:"enabled"` FutureType string `json:"futureType"` HighLeverageFeeExempt bool `json:"highLeverageFeeExempt"` IsEtfMarket bool `json:"isEtfMarket"` LargeOrderThreshold float32 `json:"largeOrderThreshold"` Last float64 `json:"last"` MinProvideSize float32 `json:"minProvideSize"` Name string `json:"name"` PostOnly bool `json:"postOnly"` Price float64 `json:"price"` PriceHigh24h float64 `json:"priceHigh24h"` PriceIncrement float32 `json:"priceIncrement"` PriceLow24h float64 `json:"priceLow24h"` QuoteCurrency string `json:"quoteCurrency"` QuoteVolume24h float64 `json:"quoteVolume24h"` Restricted bool `json:"restricted"` SizeIncrement float32 `json:"sizeIncrement"` Type string `json:"type"` Underlying string `json:"underlying"` VolumeUsd24h float64 `json:"volumeUsd24h"` AdditionalProperties map[string]interface{} `json:"-"` }
Market defines model for market.
func (Market) Get ¶
Getter for additional properties for Market. Returns the specified element and whether it was found
func (Market) MarshalJSON ¶
Override default JSON handling for Market to handle AdditionalProperties
func (*Market) UnmarshalJSON ¶
Override default JSON handling for Market to handle AdditionalProperties