jsonencoder

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UseProtoNames     bool `mapstructure:"UseProtoNames"`
	EmitUnpopulated   bool `mapstructure:"emitUnpopulated"`
	EmitDefaultValues bool `mapstructure:"emitDefaultValues"`
}

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config, typeResolver *protoregistry.Types) Encoder

New creates a new JSON encoder. Type resolver is used to resolve types of messages and can be nil in which case the default resolver is used.

func (Encoder) Encode

func (e Encoder) Encode(m proto.Message) ([]byte, error)

Jump to

Keyboard shortcuts

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