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"`
	QuotedAsset   Asset              `json:"quoted_asset"`
}

AssetCurrencyPair defines model for AssetCurrencyPair.

type AssetSourceFilter

type AssetSourceFilter struct {
	SourceIdentifiers []int64 `json:"source_identifiers"`
}

AssetSourceFilter defines model for AssetSourceFilter.

type AssetTypeFilter

type AssetTypeFilter struct {
	UniversalIdentifiers []int64 `json:"universal_identifiers"`
}

AssetTypeFilter defines model for AssetTypeFilter.

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 PostAssetsStorageApiV1GetAssetsJSONBody

type PostAssetsStorageApiV1GetAssetsJSONBody struct {
	SourceFilter *AssetSourceFilter `json:"source_filter,omitempty"`
	TimeFilter   *TimeFilter        `json:"time_filter,omitempty"`
	TypeFilter   *AssetTypeFilter   `json:"type_filter,omitempty"`
}

PostAssetsStorageApiV1GetAssetsJSONBody defines parameters for PostAssetsStorageApiV1GetAssets.

type PostAssetsStorageApiV1GetAssetsJSONRequestBody

type PostAssetsStorageApiV1GetAssetsJSONRequestBody PostAssetsStorageApiV1GetAssetsJSONBody

PostAssetsStorageApiV1GetAssetsJSONRequestBody defines body for PostAssetsStorageApiV1GetAssets for application/json ContentType.

type PostAssetsStorageApiV1GetAssetsParams

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

PostAssetsStorageApiV1GetAssetsParams defines parameters for PostAssetsStorageApiV1GetAssets.

type PutAssetsStorageApiV1AddAssetsJSONBody

type PutAssetsStorageApiV1AddAssetsJSONBody struct {
	AssetPairs []RequestAssetCurrencyPair `json:"asset_pairs"`
}

PutAssetsStorageApiV1AddAssetsJSONBody defines parameters for PutAssetsStorageApiV1AddAssets.

type PutAssetsStorageApiV1AddAssetsJSONRequestBody

type PutAssetsStorageApiV1AddAssetsJSONRequestBody PutAssetsStorageApiV1AddAssetsJSONBody

PutAssetsStorageApiV1AddAssetsJSONRequestBody defines body for PutAssetsStorageApiV1AddAssets for application/json ContentType.

type PutAssetsStorageApiV1AddAssetsParams

type PutAssetsStorageApiV1AddAssetsParams struct {
	XHermesTradeAssetSourceIdentifier int `json:"X-HermesTrade-Asset-Source-Identifier"`
}

PutAssetsStorageApiV1AddAssetsParams defines parameters for PutAssetsStorageApiV1AddAssets.

type RequestAssetCurrencyPair

type RequestAssetCurrencyPair struct {
	BaseAsset     Asset         `json:"base_asset"`
	CurrencyRatio CurrencyRatio `json:"currency_ratio"`
	QuotedAsset   Asset         `json:"quoted_asset"`
}

RequestAssetCurrencyPair defines model for RequestAssetCurrencyPair.

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 {
	// Add assets currency pairs to assets storage
	// (PUT /assets-storage/api/v1/add-assets)
	PutAssetsStorageApiV1AddAssets(w http.ResponseWriter, r *http.Request, params PutAssetsStorageApiV1AddAssetsParams)
	// Get assets currency pairs from storage
	// (POST /assets-storage/api/v1/get-assets)
	PostAssetsStorageApiV1GetAssets(w http.ResponseWriter, r *http.Request, params PostAssetsStorageApiV1GetAssetsParams)
}

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

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

PostAssetsStorageApiV1GetAssets operation middleware

func (*ServerInterfaceWrapper) PutAssetsStorageApiV1AddAssets

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

PutAssetsStorageApiV1AddAssets operation middleware

type TimeFilter

type TimeFilter struct {
	EndDate   *time.Time `json:"end_date,omitempty"`
	StartDate *time.Time `json:"start_date,omitempty"`
}

TimeFilter defines model for TimeFilter.

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

func (_ Unimplemented) PostAssetsStorageApiV1GetAssets(w http.ResponseWriter, r *http.Request, params PostAssetsStorageApiV1GetAssetsParams)

Get assets currency pairs from storage (POST /assets-storage/api/v1/get-assets)

func (Unimplemented) PutAssetsStorageApiV1AddAssets

func (_ Unimplemented) PutAssetsStorageApiV1AddAssets(w http.ResponseWriter, r *http.Request, params PutAssetsStorageApiV1AddAssetsParams)

Add assets currency pairs to assets storage (PUT /assets-storage/api/v1/add-assets)

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