dto

package
v0.0.0-...-2e430cb Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package dto provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type Asset

type Asset struct {
	ExternalIdentifier  int64 `json:"external_identifier"`
	UniversalIdentifier int64 `json:"universal_identifier"`
}

Asset defines model for Asset.

type AssetCurrencyPair

type AssetCurrencyPair struct {
	BaseAsset     Asset               `json:"base_asset"`
	CurrencyRatio CurrencyRatio       `json:"currency_ratio"`
	Identifier    *openapi_types.UUID `json:"identifier,omitempty"`
	QuotedAsset   Asset               `json:"quoted_asset"`
}

AssetCurrencyPair defines model for AssetCurrencyPair.

type AssetCurrencyPairWithLinks struct {
	BaseAsset     Asset              `json:"base_asset"`
	CurrencyRatio CurrencyRatio      `json:"currency_ratio"`
	Identifier    openapi_types.UUID `json:"identifier"`
	PairLink      string             `json:"pair_link"`
	QuotedAsset   Asset              `json:"quoted_asset"`
	SourceLink    string             `json:"source_link"`
}

AssetCurrencyPairWithLinks defines model for AssetCurrencyPairWithLinks.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type CurrencyRatio

type CurrencyRatio struct {
	Precision int64 `json:"precision"`
	Value     int64 `json:"value"`
}

CurrencyRatio defines model for CurrencyRatio.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PostSpreadsStorageApiV1GetSpreadsJSONBody

type PostSpreadsStorageApiV1GetSpreadsJSONBody struct {
	Identifiers []string `json:"identifiers"`
}

PostSpreadsStorageApiV1GetSpreadsJSONBody defines parameters for PostSpreadsStorageApiV1GetSpreads.

type PostSpreadsStorageApiV1GetSpreadsJSONRequestBody

type PostSpreadsStorageApiV1GetSpreadsJSONRequestBody PostSpreadsStorageApiV1GetSpreadsJSONBody

PostSpreadsStorageApiV1GetSpreadsJSONRequestBody defines body for PostSpreadsStorageApiV1GetSpreads for application/json ContentType.

type PostSpreadsStorageApiV1SearchSpreadsJSONBody

type PostSpreadsStorageApiV1SearchSpreadsJSONBody struct {
	FoundDateFilter     *SpreadFoundDateFilter     `json:"found_date_filter,omitempty"`
	LengthFilter        *SpreadLengthFilter        `json:"length_filter,omitempty"`
	ProfitabilityFilter *SpreadProfitabilityFilter `json:"profitability_filter,omitempty"`
}

PostSpreadsStorageApiV1SearchSpreadsJSONBody defines parameters for PostSpreadsStorageApiV1SearchSpreads.

type PostSpreadsStorageApiV1SearchSpreadsJSONRequestBody

type PostSpreadsStorageApiV1SearchSpreadsJSONRequestBody PostSpreadsStorageApiV1SearchSpreadsJSONBody

PostSpreadsStorageApiV1SearchSpreadsJSONRequestBody defines body for PostSpreadsStorageApiV1SearchSpreads for application/json ContentType.

type PostSpreadsStorageApiV1SearchSpreadsParams

type PostSpreadsStorageApiV1SearchSpreadsParams struct {
	Offset int64 `form:"offset" json:"offset"`
	Limit  int64 `form:"limit" json:"limit"`
}

PostSpreadsStorageApiV1SearchSpreadsParams defines parameters for PostSpreadsStorageApiV1SearchSpreads.

type PutSpreadsStorageApiV1SaveSpreadsJSONBody

type PutSpreadsStorageApiV1SaveSpreadsJSONBody struct {
	Spreads []Spread `json:"spreads"`
}

PutSpreadsStorageApiV1SaveSpreadsJSONBody defines parameters for PutSpreadsStorageApiV1SaveSpreads.

type PutSpreadsStorageApiV1SaveSpreadsJSONRequestBody

type PutSpreadsStorageApiV1SaveSpreadsJSONRequestBody PutSpreadsStorageApiV1SaveSpreadsJSONBody

PutSpreadsStorageApiV1SaveSpreadsJSONRequestBody defines body for PutSpreadsStorageApiV1SaveSpreads for application/json ContentType.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServerInterface

type ServerInterface interface {
	// Get spreads by identifiers
	// (POST /spreads-storage/api/v1/get-spreads)
	PostSpreadsStorageApiV1GetSpreads(w http.ResponseWriter, r *http.Request)
	// Save found spreads to storage
	// (PUT /spreads-storage/api/v1/save-spreads)
	PutSpreadsStorageApiV1SaveSpreads(w http.ResponseWriter, r *http.Request)
	// Search spreads by parameters
	// (POST /spreads-storage/api/v1/search-spreads)
	PostSpreadsStorageApiV1SearchSpreads(w http.ResponseWriter, r *http.Request, params PostSpreadsStorageApiV1SearchSpreadsParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) PostSpreadsStorageApiV1GetSpreads

func (siw *ServerInterfaceWrapper) PostSpreadsStorageApiV1GetSpreads(w http.ResponseWriter, r *http.Request)

PostSpreadsStorageApiV1GetSpreads operation middleware

func (*ServerInterfaceWrapper) PostSpreadsStorageApiV1SearchSpreads

func (siw *ServerInterfaceWrapper) PostSpreadsStorageApiV1SearchSpreads(w http.ResponseWriter, r *http.Request)

PostSpreadsStorageApiV1SearchSpreads operation middleware

func (*ServerInterfaceWrapper) PutSpreadsStorageApiV1SaveSpreads

func (siw *ServerInterfaceWrapper) PutSpreadsStorageApiV1SaveSpreads(w http.ResponseWriter, r *http.Request)

PutSpreadsStorageApiV1SaveSpreads operation middleware

type Spread

type Spread struct {
	Elements        []AssetCurrencyPair `json:"elements"`
	Identifier      openapi_types.UUID  `json:"identifier"`
	MetaInformation struct {
		FoundAt              time.Time                  `json:"found_at"`
		ProfitabilityPercent SpreadProfitabilityPercent `json:"profitability_percent"`
		SpreadLength         int64                      `json:"spread_length"`
	} `json:"meta_information"`
}

Spread defines model for Spread.

type SpreadFoundDateFilter

type SpreadFoundDateFilter struct {
	EndFoundDate   *time.Time `json:"end_found_date,omitempty"`
	StartFoundDate *time.Time `json:"start_found_date,omitempty"`
}

SpreadFoundDateFilter defines model for SpreadFoundDateFilter.

type SpreadFull

type SpreadFull struct {
	Elements        []AssetCurrencyPairWithLinks `json:"elements"`
	Identifier      openapi_types.UUID           `json:"identifier"`
	MetaInformation struct {
		FoundAt              time.Time                  `json:"found_at"`
		ProfitabilityPercent SpreadProfitabilityPercent `json:"profitability_percent"`
		SpreadLength         int64                      `json:"spread_length"`
	} `json:"meta_information"`
}

SpreadFull defines model for SpreadFull.

type SpreadLengthFilter

type SpreadLengthFilter struct {
	MaxSpreadLength *int64 `json:"max_spread_length,omitempty"`
	MinSpreadLength *int64 `json:"min_spread_length,omitempty"`
}

SpreadLengthFilter defines model for SpreadLengthFilter.

type SpreadProfitabilityFilter

type SpreadProfitabilityFilter struct {
	MaxProfitabilityPercent *SpreadProfitabilityPercent `json:"max_profitability_percent,omitempty"`
	MinProfitabilityPercent *SpreadProfitabilityPercent `json:"min_profitability_percent,omitempty"`
}

SpreadProfitabilityFilter defines model for SpreadProfitabilityFilter.

type SpreadProfitabilityPercent

type SpreadProfitabilityPercent struct {
	Precision int64 `json:"precision"`
	Value     int64 `json:"value"`
}

SpreadProfitabilityPercent defines model for SpreadProfitabilityPercent.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) PostSpreadsStorageApiV1GetSpreads

func (_ Unimplemented) PostSpreadsStorageApiV1GetSpreads(w http.ResponseWriter, r *http.Request)

Get spreads by identifiers (POST /spreads-storage/api/v1/get-spreads)

func (Unimplemented) PostSpreadsStorageApiV1SearchSpreads

func (_ Unimplemented) PostSpreadsStorageApiV1SearchSpreads(w http.ResponseWriter, r *http.Request, params PostSpreadsStorageApiV1SearchSpreadsParams)

Search spreads by parameters (POST /spreads-storage/api/v1/search-spreads)

func (Unimplemented) PutSpreadsStorageApiV1SaveSpreads

func (_ Unimplemented) PutSpreadsStorageApiV1SaveSpreads(w http.ResponseWriter, r *http.Request)

Save found spreads to storage (PUT /spreads-storage/api/v1/save-spreads)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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