Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_codec_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type BinaryCodec ¶
type BinaryCodec interface { Marshal(message any) ([]byte, error) Unmarshal(data []byte, ptr any) error ToAny(proto.Message) (*anypb.Any, error) FromAny(*anypb.Any) (proto.Message, error) }
BinaryCodec is an interface model that defines the requirements for binary encoding and decoding A binary encoder converts data into a compact, non-human-readable binary format, which is highly efficient in terms of both storage size and speed for serialization and deserialization
type JSONCodec ¶
type JSONCodec interface { json.Marshaler json.Unmarshaler }
JSONCodec is an interface model that defines requirements for json encoding and decoding converts data into a human-readable text format (JSON) which can be more friendly but less performant
type Protobuf ¶
type Protobuf struct{}
Protobuf is an encoding implementation for protobuf
type Test ¶
type Test struct { I uint64 `protobuf:"varint,1,opt,name=i,proto3" json:"i,omitempty"` // contains filtered or unexported fields }
***************************************************************************************************** This file is auto-generated from source files in `/lib/.proto/*` using Protocol Buffers (protobuf)
Protobuf is a language-neutral, platform-neutral serialization format. It allows users to define objects in a way that’s both efficient to store and fast to transmit over the network. These definitions are compiled into code that *enables different systems and programming languages to communicate in a byte-perfect manner*
To update these structures, make changes to the source .proto files, then recompile to regenerate this file. These auto-generated files are easily recognized by checking for a `.pb.go` ending ***************************************************************************************************** _ _ _ Test is a structure purely used to test the 'codec' package
func (*Test) Descriptor
deprecated
func (*Test) ProtoMessage ¶
func (*Test) ProtoMessage()
func (*Test) ProtoReflect ¶
func (x *Test) ProtoReflect() protoreflect.Message