gojopb

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultMarshalOptions   protojson.MarshalOptions
	DefaultUnmarshalOptions protojson.UnmarshalOptions
)

Options for marshal and unmarshal operations. A copy will be made before operation as the content of option will be modified (nil Resolver will be set) during operation.

View Source
var ErrNilMessageReference = errors.New("nil message reference")

ErrNilMessageReference indicate given message reference is nil.

Functions

This section is empty.

Types

type ProtobufJSON added in v0.0.2

type ProtobufJSON struct {
	Message proto.Message
}

ProtobufJSON wrap protocol buffers message make it able to marshal and unmarshal with encoding/json package.

func NewProtobufJSON added in v0.0.6

func NewProtobufJSON(msg proto.Message) ProtobufJSON

NewProtobufJSON wrap given protocol buffers message into ProtobufJSON.

func (*ProtobufJSON) MarshalJSON added in v0.0.2

func (m *ProtobufJSON) MarshalJSON() ([]byte, error)

func (*ProtobufJSON) UnmarshalJSON added in v0.0.2

func (m *ProtobufJSON) UnmarshalJSON(buf []byte) error

Jump to

Keyboard shortcuts

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