protos

package
v0.0.0-...-98b9d28 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Protos

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

Protos performs protobuf-related operations.

func New

func New(protoc, dir string, deterministic bool, makeFS func(string) fs.FS, fileReg *protoregistry.Files, mute bool) (*Protos, error)

New returns a new Protos performing operations with protobuf types under dir.

dir can be an empty string, which implies that there is no intent to query protobufs.

func (*Protos) ProtoBytes

func (p *Protos) ProtoBytes(message protoreflect.FullName, fromJSON string) ([]byte, error)

ProtoBytes converts a JSON representation of the specified message into protobuf bytes.

Deterministic serialization is used for illistration purposes only. It should not be relied on in production environments. More info, https://pkg.go.dev/google.golang.org/protobuf/proto#MarshalOptions

func (*Protos) StringerFor

func (p *Protos) StringerFor(om *config.OutMessage) (func([]byte) (string, error), error)

StringerFor returns a function to convert protobuf-encoded messages represented by om to string.

TODO: default stringer (when template is not deifined, traverses and includes all props+values)

Jump to

Keyboard shortcuts

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