geminiv1

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: 8 Imported by: 0

Documentation

Overview

Package geminiv1 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 NewGetAllSymbolsRequest

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

NewGetAllSymbolsRequest generates requests for GetAllSymbols

func NewGetPriceFeedRequest

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

NewGetPriceFeedRequest generates requests for GetPriceFeed

func NewGetSymbolDetailsRequest

func NewGetSymbolDetailsRequest(server string, symbol string) (*http.Request, error)

NewGetSymbolDetailsRequest generates requests for GetSymbolDetails

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

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

func (*Client) GetPriceFeed

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

func (*Client) GetSymbolDetails

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

type ClientInterface

type ClientInterface interface {
	// GetPriceFeed request
	GetPriceFeed(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAllSymbols request
	GetAllSymbols(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSymbolDetails request
	GetSymbolDetails(ctx context.Context, symbol string, 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) GetAllSymbolsWithResponse

func (c *ClientWithResponses) GetAllSymbolsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllSymbolsResponse, error)

GetAllSymbolsWithResponse request returning *GetAllSymbolsResponse

func (*ClientWithResponses) GetPriceFeedWithResponse

func (c *ClientWithResponses) GetPriceFeedWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPriceFeedResponse, error)

GetPriceFeedWithResponse request returning *GetPriceFeedResponse

func (*ClientWithResponses) GetSymbolDetailsWithResponse

func (c *ClientWithResponses) GetSymbolDetailsWithResponse(ctx context.Context, symbol string, reqEditors ...RequestEditorFn) (*GetSymbolDetailsResponse, error)

GetSymbolDetailsWithResponse request returning *GetSymbolDetailsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetPriceFeed request
	GetPriceFeedWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPriceFeedResponse, error)

	// GetAllSymbols request
	GetAllSymbolsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllSymbolsResponse, error)

	// GetSymbolDetails request
	GetSymbolDetailsWithResponse(ctx context.Context, symbol string, reqEditors ...RequestEditorFn) (*GetSymbolDetailsResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type GetAllSymbolsResponse

type GetAllSymbolsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Symbol
}

func ParseGetAllSymbolsResponse

func ParseGetAllSymbolsResponse(rsp *http.Response) (*GetAllSymbolsResponse, error)

ParseGetAllSymbolsResponse parses an HTTP response from a GetAllSymbolsWithResponse call

func (GetAllSymbolsResponse) Status

func (r GetAllSymbolsResponse) Status() string

Status returns HTTPResponse.Status

func (GetAllSymbolsResponse) StatusCode

func (r GetAllSymbolsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPriceFeedResponse

type GetPriceFeedResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]PriceFeed
}

func ParseGetPriceFeedResponse

func ParseGetPriceFeedResponse(rsp *http.Response) (*GetPriceFeedResponse, error)

ParseGetPriceFeedResponse parses an HTTP response from a GetPriceFeedWithResponse call

func (GetPriceFeedResponse) Status

func (r GetPriceFeedResponse) Status() string

Status returns HTTPResponse.Status

func (GetPriceFeedResponse) StatusCode

func (r GetPriceFeedResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSymbolDetailsResponse

type GetSymbolDetailsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TradingPair
}

func ParseGetSymbolDetailsResponse

func ParseGetSymbolDetailsResponse(rsp *http.Response) (*GetSymbolDetailsResponse, error)

ParseGetSymbolDetailsResponse parses an HTTP response from a GetSymbolDetailsWithResponse call

func (GetSymbolDetailsResponse) Status

func (r GetSymbolDetailsResponse) Status() string

Status returns HTTPResponse.Status

func (GetSymbolDetailsResponse) StatusCode

func (r GetSymbolDetailsResponse) 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 PriceFeed

type PriceFeed struct {
	Pair                 string                 `json:"pair"`
	PercentChange24h     string                 `json:"percentChange24h"`
	Price                string                 `json:"price"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

PriceFeed defines model for priceFeed.

func (PriceFeed) Get

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

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

func (PriceFeed) MarshalJSON

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

Override default JSON handling for PriceFeed to handle AdditionalProperties

func (*PriceFeed) Set

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

Setter for additional properties for PriceFeed

func (*PriceFeed) UnmarshalJSON

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

Override default JSON handling for PriceFeed 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

type Symbol

type Symbol = string

Symbol defines model for symbol.

type TradingPair

type TradingPair struct {
	BaseCurrency         string                 `json:"base_currency"`
	MinOrderSize         string                 `json:"min_order_size"`
	QuoteCurrency        string                 `json:"quote_currency"`
	QuoteIncrement       float64                `json:"quote_increment"`
	Status               string                 `json:"status"`
	Symbol               string                 `json:"symbol"`
	TickSize             float64                `json:"tick_size"`
	WrapEnabled          bool                   `json:"wrap_enabled"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

TradingPair defines model for tradingPair.

func (TradingPair) Get

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

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

func (TradingPair) MarshalJSON

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

Override default JSON handling for TradingPair to handle AdditionalProperties

func (*TradingPair) Set

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

Setter for additional properties for TradingPair

func (*TradingPair) UnmarshalJSON

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

Override default JSON handling for TradingPair to handle AdditionalProperties

Jump to

Keyboard shortcuts

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