genproto2

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0, UNKNOWN, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Overview

Package genproto2 generates Go methods that directly encode/decode protobuf3 wire format bytes, without intermediate proto.Message structs. The generated bytes are identical to what amino.MarshalReflect produces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P3Context2

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

P3Context2 holds state for generating protobuf3 direct-encoding methods.

func NewP3Context2

func NewP3Context2(cdc *amino.Codec) *P3Context2

NewP3Context2 creates a generator context with the given codec.

func (*P3Context2) GenerateProtobuf3ForTypes

func (ctx *P3Context2) GenerateProtobuf3ForTypes(pkg string, rtz ...reflect.Type) (string, error)

GenerateProtobuf3ForTypes generates source text for the given types. pkg is the Go package name for the generated file. The returned string is valid Go source.

func (*P3Context2) WriteProto3Schema

func (ctx *P3Context2) WriteProto3Schema(pkg *amino.Package)

WriteProto3Schema generates the .proto schema file for a package, exactly as genproto.WriteProto3Schema does.

func (*P3Context2) WriteProtobuf3

func (ctx *P3Context2) WriteProtobuf3(pkg *amino.Package)

WriteProtobuf3 generates pb3_gen.go in the package's directory.

func (*P3Context2) WriteProtobuf3ForTypes

func (ctx *P3Context2) WriteProtobuf3ForTypes(filename, pkg string, rtz ...reflect.Type) error

WriteProtobuf3ForTypes generates and writes source to the given filename.

Jump to

Keyboard shortcuts

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