price

package
v0.0.0-...-299512e Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const GetPriceOKCode int = 200

GetPriceOKCode is the HTTP code returned for type GetPriceOK

Variables

This section is empty.

Functions

This section is empty.

Types

type GetPrice

type GetPrice struct {
	Context *middleware.Context
	Handler GetPriceHandler
}

GetPrice swagger:route GET /price price getPrice

Get price

Get a random price

func NewGetPrice

func NewGetPrice(ctx *middleware.Context, handler GetPriceHandler) *GetPrice

NewGetPrice creates a new http.Handler for the get price operation

func (*GetPrice) ServeHTTP

func (o *GetPrice) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type GetPriceHandler

type GetPriceHandler interface {
	Handle(GetPriceParams) middleware.Responder
}

GetPriceHandler interface for that can handle valid get price params

type GetPriceHandlerFunc

type GetPriceHandlerFunc func(GetPriceParams) middleware.Responder

GetPriceHandlerFunc turns a function with the right signature into a get price handler

func (GetPriceHandlerFunc) Handle

Handle executing the request and returning a response

type GetPriceOK

type GetPriceOK struct {

	/*
	  In: Body
	*/
	Payload *GetPriceOKBody `json:"body,omitempty"`
}

GetPriceOK login

swagger:response getPriceOK

func NewGetPriceOK

func NewGetPriceOK() *GetPriceOK

NewGetPriceOK creates GetPriceOK with default headers values

func (*GetPriceOK) SetPayload

func (o *GetPriceOK) SetPayload(payload *GetPriceOKBody)

SetPayload sets the payload to the get price o k response

func (*GetPriceOK) WithPayload

func (o *GetPriceOK) WithPayload(payload *GetPriceOKBody) *GetPriceOK

WithPayload adds the payload to the get price o k response

func (*GetPriceOK) WriteResponse

func (o *GetPriceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type GetPriceOKBody

type GetPriceOKBody struct {

	// price
	Price float32 `json:"price,omitempty"`
}

GetPriceOKBody get price o k body swagger:model GetPriceOKBody

func (*GetPriceOKBody) MarshalBinary

func (o *GetPriceOKBody) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*GetPriceOKBody) UnmarshalBinary

func (o *GetPriceOKBody) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*GetPriceOKBody) Validate

func (o *GetPriceOKBody) Validate(formats strfmt.Registry) error

Validate validates this get price o k body

type GetPriceParams

type GetPriceParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*Target coin symbol
	  In: query
	*/
	Convert *string
	/*Source coin symbol
	  In: query
	*/
	Symbol *string
}

GetPriceParams contains all the bound params for the get price operation typically these are obtained from a http.Request

swagger:parameters getPrice

func NewGetPriceParams

func NewGetPriceParams() GetPriceParams

NewGetPriceParams creates a new GetPriceParams object no default values defined in spec.

func (*GetPriceParams) BindRequest

func (o *GetPriceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewGetPriceParams() beforehand.

type GetPriceURL

type GetPriceURL struct {
	Convert *string
	Symbol  *string
	// contains filtered or unexported fields
}

GetPriceURL generates an URL for the get price operation

func (*GetPriceURL) Build

func (o *GetPriceURL) Build() (*url.URL, error)

Build a url path and query string

func (*GetPriceURL) BuildFull

func (o *GetPriceURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*GetPriceURL) Must

func (o *GetPriceURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*GetPriceURL) SetBasePath

func (o *GetPriceURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*GetPriceURL) String

func (o *GetPriceURL) String() string

String returns the string representation of the path with query string

func (*GetPriceURL) StringFull

func (o *GetPriceURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*GetPriceURL) WithBasePath

func (o *GetPriceURL) WithBasePath(bp string) *GetPriceURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

Jump to

Keyboard shortcuts

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