package protobuf

import "github.com/nats-io/nats.go/encoders/protobuf"

Index

Constants

const (
	PROTOBUF_ENCODER = "protobuf"
)

Additional index for registered Encoders.

Variables

var (
	ErrInvalidProtoMsgEncode = errors.New("nats: Invalid protobuf proto.Message object passed to encode")
	ErrInvalidProtoMsgDecode = errors.New("nats: Invalid protobuf proto.Message object passed to decode")
)

Types

type ProtobufEncoder

type ProtobufEncoder struct {
}

ProtobufEncoder is a protobuf implementation for EncodedConn This encoder will use the builtin protobuf lib to Marshal and Unmarshal structs.

func (*ProtobufEncoder) Decode

func (pb *ProtobufEncoder) Decode(subject string, data []byte, vPtr interface{}) error

Decode

func (*ProtobufEncoder) Encode

func (pb *ProtobufEncoder) Encode(subject string, v interface{}) ([]byte, error)

Encode

Source Files

protobuf_enc.go

Version
v1.16.0
Published
May 26, 2022
Platform
js/wasm
Imports
3 packages
Last checked
34 minutes ago

Tools for package owners.