rainv1

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 rainv1 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 NewGetAllCoinsRequest

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

NewGetAllCoinsRequest generates requests for GetAllCoins

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

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

type ClientInterface

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

func (c *ClientWithResponses) GetAllCoinsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllCoinsResponse, error)

GetAllCoinsWithResponse request returning *GetAllCoinsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetAllCoins request
	GetAllCoinsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllCoinsResponse, error)
}

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

type Coin

type Coin struct {
	BlockExplorer          string                 `json:"block_explorer"`
	Categories             []string               `json:"categories"`
	Code                   string                 `json:"code"`
	ExchangeWarningMinimum string                 `json:"exchange_warning_minimum"`
	Extensions             []Extension            `json:"extensions"`
	FiatPrecision          int                    `json:"fiat_precision"`
	IconUrl                string                 `json:"icon_url"`
	MinimumAmount          string                 `json:"minimum_amount"`
	MinimumConfirmations   int                    `json:"minimum_confirmations"`
	Name                   string                 `json:"name"`
	Networks               []Network              `json:"networks"`
	Precision              int                    `json:"precision"`
	Status                 string                 `json:"status"`
	StatusChangedAt        time.Time              `json:"status_changed_at"`
	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 Extension

type Extension struct {
	Name                 string                 `json:"name"`
	Type                 string                 `json:"type"`
	Value                string                 `json:"value"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

Extension defines model for extension.

func (Extension) Get

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

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

func (Extension) MarshalJSON

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

Override default JSON handling for Extension to handle AdditionalProperties

func (*Extension) Set

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

Setter for additional properties for Extension

func (*Extension) UnmarshalJSON

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

Override default JSON handling for Extension to handle AdditionalProperties

type GetAllCoinsResponse

type GetAllCoinsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GetCoinsResponse
}

func ParseGetAllCoinsResponse

func ParseGetAllCoinsResponse(rsp *http.Response) (*GetAllCoinsResponse, error)

ParseGetAllCoinsResponse parses an HTTP response from a GetAllCoinsWithResponse call

func (GetAllCoinsResponse) Status

func (r GetAllCoinsResponse) Status() string

Status returns HTTPResponse.Status

func (GetAllCoinsResponse) StatusCode

func (r GetAllCoinsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCoinsResponse

type GetCoinsResponse struct {
	Coins                []Coin                 `json:"coins"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

GetCoinsResponse defines model for getCoinsResponse.

func (GetCoinsResponse) Get

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

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

func (GetCoinsResponse) MarshalJSON

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

Override default JSON handling for GetCoinsResponse to handle AdditionalProperties

func (*GetCoinsResponse) Set

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

Setter for additional properties for GetCoinsResponse

func (*GetCoinsResponse) UnmarshalJSON

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

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

type Network struct {
	DefaultFee           string                 `json:"default_fee"`
	Extensions           []Extension            `json:"extensions"`
	Name                 string                 `json:"name"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

Network defines model for network.

func (Network) Get

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

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

func (Network) MarshalJSON

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

Override default JSON handling for Network to handle AdditionalProperties

func (*Network) Set

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

Setter for additional properties for Network

func (*Network) UnmarshalJSON

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

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