Documentation
¶
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type Balance
- func (s *Balance) Decode(d *jx.Decoder) error
- func (s *Balance) Encode(e *jx.Encoder)
- func (s *Balance) GetBalance() OptString
- func (s *Balance) GetBalanceRawInteger() OptString
- func (s *Balance) GetBalanceUsd() OptString
- func (s *Balance) GetBlockchain() OptString
- func (s *Balance) GetContractAddress() OptString
- func (s *Balance) GetHolderAddress() OptString
- func (s *Balance) GetThumbnail() OptString
- func (s *Balance) GetTokenDecimals() OptFloat64
- func (s *Balance) GetTokenName() OptString
- func (s *Balance) GetTokenPrice() OptString
- func (s *Balance) GetTokenSymbol() OptString
- func (s *Balance) GetTokenType() OptString
- func (s *Balance) MarshalJSON() ([]byte, error)
- func (s *Balance) SetBalance(val OptString)
- func (s *Balance) SetBalanceRawInteger(val OptString)
- func (s *Balance) SetBalanceUsd(val OptString)
- func (s *Balance) SetBlockchain(val OptString)
- func (s *Balance) SetContractAddress(val OptString)
- func (s *Balance) SetHolderAddress(val OptString)
- func (s *Balance) SetThumbnail(val OptString)
- func (s *Balance) SetTokenDecimals(val OptFloat64)
- func (s *Balance) SetTokenName(val OptString)
- func (s *Balance) SetTokenPrice(val OptString)
- func (s *Balance) SetTokenSymbol(val OptString)
- func (s *Balance) SetTokenType(val OptString)
- func (s *Balance) UnmarshalJSON(data []byte) error
- func (s *Balance) Validate() error
- type BalancesReply
- func (s *BalancesReply) Decode(d *jx.Decoder) error
- func (s *BalancesReply) Encode(e *jx.Encoder)
- func (s *BalancesReply) GetAssets() []Balance
- func (s *BalancesReply) GetBlockHeight() OptFloat64
- func (s *BalancesReply) GetNextPageToken() OptString
- func (s *BalancesReply) GetTotalBalanceUsd() OptString
- func (s *BalancesReply) GetTotalCount() OptFloat64
- func (s *BalancesReply) MarshalJSON() ([]byte, error)
- func (s *BalancesReply) SetAssets(val []Balance)
- func (s *BalancesReply) SetBlockHeight(val OptFloat64)
- func (s *BalancesReply) SetNextPageToken(val OptString)
- func (s *BalancesReply) SetTotalBalanceUsd(val OptString)
- func (s *BalancesReply) SetTotalCount(val OptFloat64)
- func (s *BalancesReply) UnmarshalJSON(data []byte) error
- func (s *BalancesReply) Validate() error
- type BalancesRequest
- func (s *BalancesRequest) Decode(d *jx.Decoder) error
- func (s *BalancesRequest) Encode(e *jx.Encoder)
- func (s *BalancesRequest) GetBlockHeight() OptFloat64
- func (s *BalancesRequest) GetBlockchain() []string
- func (s *BalancesRequest) GetNativeFirst() OptBool
- func (s *BalancesRequest) GetOnlyWhitelisted() OptBool
- func (s *BalancesRequest) GetPageSize() OptString
- func (s *BalancesRequest) GetPageToken() OptString
- func (s *BalancesRequest) GetWalletAddress() string
- func (s *BalancesRequest) MarshalJSON() ([]byte, error)
- func (s *BalancesRequest) SetBlockHeight(val OptFloat64)
- func (s *BalancesRequest) SetBlockchain(val []string)
- func (s *BalancesRequest) SetNativeFirst(val OptBool)
- func (s *BalancesRequest) SetOnlyWhitelisted(val OptBool)
- func (s *BalancesRequest) SetPageSize(val OptString)
- func (s *BalancesRequest) SetPageToken(val OptString)
- func (s *BalancesRequest) SetWalletAddress(val string)
- func (s *BalancesRequest) UnmarshalJSON(data []byte) error
- func (s *BalancesRequest) Validate() error
- type Client
- type ClientOption
- type ErrorHandler
- type Handler
- type Invoker
- type Middleware
- type OptBool
- func (o *OptBool) Decode(d *jx.Decoder) error
- func (o OptBool) Encode(e *jx.Encoder)
- func (o OptBool) Get() (v bool, ok bool)
- func (o OptBool) IsSet() bool
- func (s OptBool) MarshalJSON() ([]byte, error)
- func (o OptBool) Or(d bool) bool
- func (o *OptBool) Reset()
- func (o *OptBool) SetTo(v bool)
- func (s *OptBool) UnmarshalJSON(data []byte) error
- type OptFloat64
- func (o *OptFloat64) Decode(d *jx.Decoder) error
- func (o OptFloat64) Encode(e *jx.Encoder)
- func (o OptFloat64) Get() (v float64, ok bool)
- func (o OptFloat64) IsSet() bool
- func (s OptFloat64) MarshalJSON() ([]byte, error)
- func (o OptFloat64) Or(d float64) float64
- func (o *OptFloat64) Reset()
- func (o *OptFloat64) SetTo(v float64)
- func (s *OptFloat64) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type Option
- type Route
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type UnimplementedHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Balance ¶
type Balance struct {
Blockchain OptString `json:"blockchain"`
TokenName OptString `json:"tokenName"`
TokenSymbol OptString `json:"tokenSymbol"`
TokenDecimals OptFloat64 `json:"tokenDecimals"`
TokenType OptString `json:"tokenType"`
ContractAddress OptString `json:"contractAddress"`
HolderAddress OptString `json:"holderAddress"`
Balance OptString `json:"balance"`
BalanceRawInteger OptString `json:"balanceRawInteger"`
BalanceUsd OptString `json:"balanceUsd"`
TokenPrice OptString `json:"tokenPrice"`
Thumbnail OptString `json:"thumbnail"`
}
Ref: #/components/schemas/Balance
func (*Balance) GetBalance ¶
GetBalance returns the value of Balance.
func (*Balance) GetBalanceRawInteger ¶
GetBalanceRawInteger returns the value of BalanceRawInteger.
func (*Balance) GetBalanceUsd ¶
GetBalanceUsd returns the value of BalanceUsd.
func (*Balance) GetBlockchain ¶
GetBlockchain returns the value of Blockchain.
func (*Balance) GetContractAddress ¶
GetContractAddress returns the value of ContractAddress.
func (*Balance) GetHolderAddress ¶
GetHolderAddress returns the value of HolderAddress.
func (*Balance) GetThumbnail ¶
GetThumbnail returns the value of Thumbnail.
func (*Balance) GetTokenDecimals ¶
func (s *Balance) GetTokenDecimals() OptFloat64
GetTokenDecimals returns the value of TokenDecimals.
func (*Balance) GetTokenName ¶
GetTokenName returns the value of TokenName.
func (*Balance) GetTokenPrice ¶
GetTokenPrice returns the value of TokenPrice.
func (*Balance) GetTokenSymbol ¶
GetTokenSymbol returns the value of TokenSymbol.
func (*Balance) GetTokenType ¶
GetTokenType returns the value of TokenType.
func (*Balance) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Balance) SetBalance ¶
SetBalance sets the value of Balance.
func (*Balance) SetBalanceRawInteger ¶
SetBalanceRawInteger sets the value of BalanceRawInteger.
func (*Balance) SetBalanceUsd ¶
SetBalanceUsd sets the value of BalanceUsd.
func (*Balance) SetBlockchain ¶
SetBlockchain sets the value of Blockchain.
func (*Balance) SetContractAddress ¶
SetContractAddress sets the value of ContractAddress.
func (*Balance) SetHolderAddress ¶
SetHolderAddress sets the value of HolderAddress.
func (*Balance) SetThumbnail ¶
SetThumbnail sets the value of Thumbnail.
func (*Balance) SetTokenDecimals ¶
func (s *Balance) SetTokenDecimals(val OptFloat64)
SetTokenDecimals sets the value of TokenDecimals.
func (*Balance) SetTokenName ¶
SetTokenName sets the value of TokenName.
func (*Balance) SetTokenPrice ¶
SetTokenPrice sets the value of TokenPrice.
func (*Balance) SetTokenSymbol ¶
SetTokenSymbol sets the value of TokenSymbol.
func (*Balance) SetTokenType ¶
SetTokenType sets the value of TokenType.
func (*Balance) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type BalancesReply ¶
type BalancesReply struct {
NextPageToken OptString `json:"nextPageToken"`
TotalBalanceUsd OptString `json:"totalBalanceUsd"`
TotalCount OptFloat64 `json:"totalCount"`
Assets []Balance `json:"assets"`
BlockHeight OptFloat64 `json:"blockHeight"`
}
Ref: #/components/schemas/BalancesReply
func (*BalancesReply) Decode ¶
func (s *BalancesReply) Decode(d *jx.Decoder) error
Decode decodes BalancesReply from json.
func (*BalancesReply) Encode ¶
func (s *BalancesReply) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*BalancesReply) GetAssets ¶
func (s *BalancesReply) GetAssets() []Balance
GetAssets returns the value of Assets.
func (*BalancesReply) GetBlockHeight ¶
func (s *BalancesReply) GetBlockHeight() OptFloat64
GetBlockHeight returns the value of BlockHeight.
func (*BalancesReply) GetNextPageToken ¶
func (s *BalancesReply) GetNextPageToken() OptString
GetNextPageToken returns the value of NextPageToken.
func (*BalancesReply) GetTotalBalanceUsd ¶
func (s *BalancesReply) GetTotalBalanceUsd() OptString
GetTotalBalanceUsd returns the value of TotalBalanceUsd.
func (*BalancesReply) GetTotalCount ¶
func (s *BalancesReply) GetTotalCount() OptFloat64
GetTotalCount returns the value of TotalCount.
func (*BalancesReply) MarshalJSON ¶
func (s *BalancesReply) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*BalancesReply) SetAssets ¶
func (s *BalancesReply) SetAssets(val []Balance)
SetAssets sets the value of Assets.
func (*BalancesReply) SetBlockHeight ¶
func (s *BalancesReply) SetBlockHeight(val OptFloat64)
SetBlockHeight sets the value of BlockHeight.
func (*BalancesReply) SetNextPageToken ¶
func (s *BalancesReply) SetNextPageToken(val OptString)
SetNextPageToken sets the value of NextPageToken.
func (*BalancesReply) SetTotalBalanceUsd ¶
func (s *BalancesReply) SetTotalBalanceUsd(val OptString)
SetTotalBalanceUsd sets the value of TotalBalanceUsd.
func (*BalancesReply) SetTotalCount ¶
func (s *BalancesReply) SetTotalCount(val OptFloat64)
SetTotalCount sets the value of TotalCount.
func (*BalancesReply) UnmarshalJSON ¶
func (s *BalancesReply) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*BalancesReply) Validate ¶
func (s *BalancesReply) Validate() error
type BalancesRequest ¶
type BalancesRequest struct {
WalletAddress string `json:"walletAddress"`
Blockchain []string `json:"blockchain"`
BlockHeight OptFloat64 `json:"blockHeight"`
OnlyWhitelisted OptBool `json:"onlyWhitelisted"`
NativeFirst OptBool `json:"nativeFirst"`
PageSize OptString `json:"pageSize"`
PageToken OptString `json:"pageToken"`
}
Ref: #/components/schemas/BalancesRequest
func (*BalancesRequest) Decode ¶
func (s *BalancesRequest) Decode(d *jx.Decoder) error
Decode decodes BalancesRequest from json.
func (*BalancesRequest) Encode ¶
func (s *BalancesRequest) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*BalancesRequest) GetBlockHeight ¶
func (s *BalancesRequest) GetBlockHeight() OptFloat64
GetBlockHeight returns the value of BlockHeight.
func (*BalancesRequest) GetBlockchain ¶
func (s *BalancesRequest) GetBlockchain() []string
GetBlockchain returns the value of Blockchain.
func (*BalancesRequest) GetNativeFirst ¶
func (s *BalancesRequest) GetNativeFirst() OptBool
GetNativeFirst returns the value of NativeFirst.
func (*BalancesRequest) GetOnlyWhitelisted ¶
func (s *BalancesRequest) GetOnlyWhitelisted() OptBool
GetOnlyWhitelisted returns the value of OnlyWhitelisted.
func (*BalancesRequest) GetPageSize ¶
func (s *BalancesRequest) GetPageSize() OptString
GetPageSize returns the value of PageSize.
func (*BalancesRequest) GetPageToken ¶
func (s *BalancesRequest) GetPageToken() OptString
GetPageToken returns the value of PageToken.
func (*BalancesRequest) GetWalletAddress ¶
func (s *BalancesRequest) GetWalletAddress() string
GetWalletAddress returns the value of WalletAddress.
func (*BalancesRequest) MarshalJSON ¶
func (s *BalancesRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*BalancesRequest) SetBlockHeight ¶
func (s *BalancesRequest) SetBlockHeight(val OptFloat64)
SetBlockHeight sets the value of BlockHeight.
func (*BalancesRequest) SetBlockchain ¶
func (s *BalancesRequest) SetBlockchain(val []string)
SetBlockchain sets the value of Blockchain.
func (*BalancesRequest) SetNativeFirst ¶
func (s *BalancesRequest) SetNativeFirst(val OptBool)
SetNativeFirst sets the value of NativeFirst.
func (*BalancesRequest) SetOnlyWhitelisted ¶
func (s *BalancesRequest) SetOnlyWhitelisted(val OptBool)
SetOnlyWhitelisted sets the value of OnlyWhitelisted.
func (*BalancesRequest) SetPageSize ¶
func (s *BalancesRequest) SetPageSize(val OptString)
SetPageSize sets the value of PageSize.
func (*BalancesRequest) SetPageToken ¶
func (s *BalancesRequest) SetPageToken(val OptString)
SetPageToken sets the value of PageToken.
func (*BalancesRequest) SetWalletAddress ¶
func (s *BalancesRequest) SetWalletAddress(val string)
SetWalletAddress sets the value of WalletAddress.
func (*BalancesRequest) UnmarshalJSON ¶
func (s *BalancesRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*BalancesRequest) Validate ¶
func (s *BalancesRequest) Validate() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements OAS client.
func NewClient ¶
func NewClient(serverURL string, opts ...ClientOption) (*Client, error)
NewClient initializes new Client defined by OAS.
func (*Client) GetAccountBalance ¶
func (c *Client) GetAccountBalance(ctx context.Context, request *BalancesRequest) (*BalancesReply, error)
GetAccountBalance invokes getAccountBalance operation.
Returns geven address balance in all requested chains.
POST /accountBalance
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is client config option.
func WithClient ¶
func WithClient(client ht.Client) ClientOption
WithClient specifies http client to use.
type Handler ¶
type Handler interface {
// GetAccountBalance implements getAccountBalance operation.
//
// Returns geven address balance in all requested chains.
//
// POST /accountBalance
GetAccountBalance(ctx context.Context, req *BalancesRequest) (*BalancesReply, error)
}
Handler handles operations described by OpenAPI v3 specification.
type Invoker ¶
type Invoker interface {
// GetAccountBalance invokes getAccountBalance operation.
//
// Returns geven address balance in all requested chains.
//
// POST /accountBalance
GetAccountBalance(ctx context.Context, request *BalancesRequest) (*BalancesReply, error)
}
Invoker invokes operations described by OpenAPI v3 specification.
type OptBool ¶
OptBool is optional bool.
func NewOptBool ¶
NewOptBool returns new OptBool with value set to v.
func (OptBool) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptBool) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptFloat64 ¶
OptFloat64 is optional float64.
func NewOptFloat64 ¶
func NewOptFloat64(v float64) OptFloat64
NewOptFloat64 returns new OptFloat64 with value set to v.
func (*OptFloat64) Decode ¶
func (o *OptFloat64) Decode(d *jx.Decoder) error
Decode decodes float64 from json.
func (OptFloat64) Encode ¶
func (o OptFloat64) Encode(e *jx.Encoder)
Encode encodes float64 as json.
func (OptFloat64) Get ¶
func (o OptFloat64) Get() (v float64, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptFloat64) IsSet ¶
func (o OptFloat64) IsSet() bool
IsSet returns true if OptFloat64 was set.
func (OptFloat64) MarshalJSON ¶
func (s OptFloat64) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptFloat64) Or ¶
func (o OptFloat64) Or(d float64) float64
Or returns value if set, or given parameter if does not.
func (*OptFloat64) UnmarshalJSON ¶
func (s *OptFloat64) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Option ¶
type Option interface {
ServerOption
ClientOption
}
Option is config option.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for creating a meter.
If none is specified, the otel.GetMeterProvider() is used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer.
If none is specified, the global provider is used.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.
func NewServer ¶
func NewServer(h Handler, opts ...ServerOption) (*Server, error)
NewServer creates new Server.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption is server config option.
func WithErrorHandler ¶
func WithErrorHandler(h ErrorHandler) ServerOption
WithErrorHandler specifies error handler to use.
func WithMaxMultipartMemory ¶
func WithMaxMultipartMemory(max int64) ServerOption
WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.
func WithMethodNotAllowed ¶
func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
WithMethodNotAllowed specifies Method Not Allowed handler to use.
func WithMiddleware ¶
func WithMiddleware(m ...Middleware) ServerOption
WithMiddleware specifies middlewares to use.
func WithNotFound ¶
func WithNotFound(notFound http.HandlerFunc) ServerOption
WithNotFound specifies Not Found handler to use.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) ServerOption
WithPathPrefix specifies server path prefix.
type UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) GetAccountBalance ¶
func (UnimplementedHandler) GetAccountBalance(ctx context.Context, req *BalancesRequest) (r *BalancesReply, _ error)
GetAccountBalance implements getAccountBalance operation.
Returns geven address balance in all requested chains.
POST /accountBalance