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 BinaryUnmarshaler ¶ added in v0.10.0
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
Click to show internal directories.
Click to hide internal directories.