ftxv1

package
v0.0.0-...-fe50809 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetCoinsRequest

func NewGetCoinsRequest(server string) (*http.Request, error)

NewGetCoinsRequest generates requests for GetCoins

func NewGetMarketsRequest

func NewGetMarketsRequest(server string) (*http.Request, error)

NewGetMarketsRequest generates requests for GetMarkets

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) GetCoins

func (c *Client) GetCoins(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetMarkets

func (c *Client) GetMarkets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

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

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

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

func (a Coin) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for Coin. Returns the specified element and whether it was found

func (Coin) MarshalJSON

func (a Coin) MarshalJSON() ([]byte, error)

Override default JSON handling for Coin to handle AdditionalProperties

func (*Coin) Set

func (a *Coin) Set(fieldName string, value interface{})

Setter for additional properties for Coin

func (*Coin) UnmarshalJSON

func (a *Coin) UnmarshalJSON(b []byte) error

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

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

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

func (a Market) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for Market. Returns the specified element and whether it was found

func (Market) MarshalJSON

func (a Market) MarshalJSON() ([]byte, error)

Override default JSON handling for Market to handle AdditionalProperties

func (*Market) Set

func (a *Market) Set(fieldName string, value interface{})

Setter for additional properties for Market

func (*Market) UnmarshalJSON

func (a *Market) UnmarshalJSON(b []byte) error

Override default JSON handling for Market to handle AdditionalProperties

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL