utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeRequestContent

func NormalizeRequestContent(query any, body any) (string, error)

Types

type AnyMessage

type AnyMessage struct {
	Response          *Response
	SubscribedMessage *SubscribedMessage
}

AnyMessage represents either a JSON Response or SubscribedMessage.

func (AnyMessage) MarshalJSON

func (m AnyMessage) MarshalJSON() ([]byte, error)

func (*AnyMessage) UnmarshalJSON

func (m *AnyMessage) UnmarshalJSON(data []byte) error

type DefaultParam

type DefaultParam struct {
	RecvWindow int    `url:"recvWindow,omitempty" validate:"omitempty"`
	Timestamp  int64  `url:"timestamp" validate:"required"`
	Signature  string `url:"signature,omitempty" validate:"omitempty"`
}

type Request

type Request struct {
	ID     uint32   `json:"id,omitempty"`
	Method string   `json:"method,omitempty"`
	Params []string `json:"params,omitempty"`
}

type Response

type Response struct {
	ID     uint `json:"id"`
	Result any  `json:"result"`
}

type SubscribedMessage

type SubscribedMessage struct {
	Stream string          `json:"stream"`
	Data   json.RawMessage `json:"data"`
}

Jump to

Keyboard shortcuts

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