proto

package module
v0.0.0-...-0b9cc3b Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MPL-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Codec = PBcodec{}

Convenience variable for simpler usage in gokv store options.

options := redis.Options{
	Encoding: proto.Codec,
}

Functions

This section is empty.

Types

type PBcodec

type PBcodec struct{}

PBcodec encodes/decodes Go values to/from protocol buffers.

func (PBcodec) Marshal

func (c PBcodec) Marshal(v any) ([]byte, error)

Marshal encodes a proto message struct into the binary wire format. Passed value can't be any Go value, but must be an object of a proto message struct.

func (PBcodec) Unmarshal

func (c PBcodec) Unmarshal(data []byte, v any) error

Unmarshal parses a wire-format message in proto message struct. Passed value can't be any Go value, but must be an object of a proto message struct.

Jump to

Keyboard shortcuts

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