cryptov2

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 cryptov2 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 NewGetAllInstrumentsRequest

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

NewGetAllInstrumentsRequest generates requests for GetAllInstruments

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

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

type ClientInterface

type ClientInterface interface {
	// GetAllInstruments request
	GetAllInstruments(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) GetAllInstrumentsWithResponse

func (c *ClientWithResponses) GetAllInstrumentsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllInstrumentsResponse, error)

GetAllInstrumentsWithResponse request returning *GetAllInstrumentsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetAllInstruments request
	GetAllInstrumentsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllInstrumentsResponse, error)
}

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

type GetAllInstrumentsResponse

type GetAllInstrumentsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GetInstrumentsResponse
}

func ParseGetAllInstrumentsResponse

func ParseGetAllInstrumentsResponse(rsp *http.Response) (*GetAllInstrumentsResponse, error)

ParseGetAllInstrumentsResponse parses an HTTP response from a GetAllInstrumentsWithResponse call

func (GetAllInstrumentsResponse) Status

func (r GetAllInstrumentsResponse) Status() string

Status returns HTTPResponse.Status

func (GetAllInstrumentsResponse) StatusCode

func (r GetAllInstrumentsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetInstrumentsResponse

type GetInstrumentsResponse struct {
	Code                 int                    `json:"code"`
	Id                   int                    `json:"id"`
	Method               string                 `json:"method"`
	Result               GetInstrumentsResult   `json:"result"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

GetInstrumentsResponse defines model for getInstrumentsResponse.

func (GetInstrumentsResponse) Get

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

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

func (GetInstrumentsResponse) MarshalJSON

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

Override default JSON handling for GetInstrumentsResponse to handle AdditionalProperties

func (*GetInstrumentsResponse) Set

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

Setter for additional properties for GetInstrumentsResponse

func (*GetInstrumentsResponse) UnmarshalJSON

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

Override default JSON handling for GetInstrumentsResponse to handle AdditionalProperties

type GetInstrumentsResult

type GetInstrumentsResult struct {
	Instruments          []Instrument           `json:"instruments"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

GetInstrumentsResult defines model for getInstrumentsResult.

func (GetInstrumentsResult) Get

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

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

func (GetInstrumentsResult) MarshalJSON

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

Override default JSON handling for GetInstrumentsResult to handle AdditionalProperties

func (*GetInstrumentsResult) Set

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

Setter for additional properties for GetInstrumentsResult

func (*GetInstrumentsResult) UnmarshalJSON

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

Override default JSON handling for GetInstrumentsResult to handle AdditionalProperties

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Instrument

type Instrument struct {
	BaseCurrency            string                 `json:"base_currency"`
	InstrumentName          string                 `json:"instrument_name"`
	LastUpdateDate          int                    `json:"last_update_date"`
	MarginTradingEnabled    bool                   `json:"margin_trading_enabled"`
	MarginTradingEnabled10x bool                   `json:"margin_trading_enabled_10x"`
	MarginTradingEnabled5x  bool                   `json:"margin_trading_enabled_5x"`
	MaxPrice                string                 `json:"max_price"`
	MaxQuantity             string                 `json:"max_quantity"`
	MinPrice                string                 `json:"min_price"`
	MinQuantity             string                 `json:"min_quantity"`
	PriceDecimals           int                    `json:"price_decimals"`
	QuantityDecimals        int                    `json:"quantity_decimals"`
	QuoteCurrency           string                 `json:"quote_currency"`
	AdditionalProperties    map[string]interface{} `json:"-"`
}

Instrument defines model for instrument.

func (Instrument) Get

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

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

func (Instrument) MarshalJSON

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

Override default JSON handling for Instrument to handle AdditionalProperties

func (*Instrument) Set

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

Setter for additional properties for Instrument

func (*Instrument) UnmarshalJSON

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

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