asynq_auxiliary

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BinaryJSON = JSON{}
View Source
var BinaryProtobuf = Protobuf{}

Functions

This section is empty.

Types

type BinaryMarshaler added in v0.10.0

type BinaryMarshaler interface {
	MarshalBinary(v any) (data []byte, err error)
}

type BinaryUnmarshaler added in v0.10.0

type BinaryUnmarshaler interface {
	UnmarshalBinary(data []byte, v any) error
}

type ClientOption

type ClientOption func(*ClientSettings)

ClientOption 客户端选项

func WithClientMarshaler added in v0.10.0

func WithClientMarshaler(marshaler BinaryMarshaler) ClientOption

WithClientMarshaler 使用指定序列化

func WithClientMarshalerJSON added in v0.10.0

func WithClientMarshalerJSON() ClientOption

WithClientMarshalerJSON 使用 json.Marshal Marshaler

func WithClientMarshalerProtobuf added in v0.10.0

func WithClientMarshalerProtobuf() ClientOption

WithClientMarshalerProtobuf 使用 proto.Marshal Marshaler

type ClientSettings

type ClientSettings struct {
	Marshaler BinaryMarshaler
}

ClientSettings 客户端配置

func NewClientSettings

func NewClientSettings(opts ...ClientOption) *ClientSettings

NewClientSettings 新建配置, 默认使用 json.Marshal

type HandlerOption

type HandlerOption func(*HandlerSettings)

HandlerOption 处理器选项

func WithHandlerUnmarshaler added in v0.10.0

func WithHandlerUnmarshaler(unmarshaler BinaryUnmarshaler) HandlerOption

WithHandlerUnmarshaler 指定反序列化

func WithHandlerUnmarshalerJSON added in v0.10.0

func WithHandlerUnmarshalerJSON() HandlerOption

WithHandlerUnmarshalerJSON 使用 json.Unmarshal Unmarshaler

func WithHandlerUnmarshalerProtobuf added in v0.10.0

func WithHandlerUnmarshalerProtobuf() HandlerOption

WithHandlerUnmarshalerProtobuf 使用 proto.Unmarshal Unmarshaler

type HandlerSettings

type HandlerSettings struct {
	Unmarshaler BinaryUnmarshaler
}

HandlerSettings 处理器配置

func NewHandlerSettings

func NewHandlerSettings(opts ...HandlerOption) *HandlerSettings

NewHandlerSettings 新建处理器选项, 默认使用 proto.Unmarshal

type JSON added in v0.10.0

type JSON struct{}

func (JSON) MarshalBinary added in v0.10.0

func (JSON) MarshalBinary(v any) ([]byte, error)

func (JSON) UnmarshalBinary added in v0.10.0

func (JSON) UnmarshalBinary(b []byte, v any) error

type Protobuf added in v0.10.0

type Protobuf struct{}

func (Protobuf) MarshalBinary added in v0.10.0

func (Protobuf) MarshalBinary(v any) ([]byte, error)

func (Protobuf) UnmarshalBinary added in v0.10.0

func (Protobuf) UnmarshalBinary(b []byte, v any) error

Jump to

Keyboard shortcuts

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