clientgen

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesEncodingContext added in v0.7.0

type BytesEncodingContext struct {
	// Message is the message that needs custom marshal/unmarshal
	Message *protogen.Message
	// BytesFields are fields with non-default bytes_encoding annotation
	BytesFields []*BytesEncodingFieldInfo
}

BytesEncodingContext holds information about messages that need custom JSON encoding for bytes fields with non-default encoding (HEX, BASE64_RAW, BASE64URL, BASE64URL_RAW).

type BytesEncodingFieldInfo added in v0.7.0

type BytesEncodingFieldInfo struct {
	Field    *protogen.Field
	Encoding http.BytesEncoding
}

BytesEncodingFieldInfo holds field info with its bytes encoding setting.

type EmptyBehaviorContext added in v0.6.0

type EmptyBehaviorContext struct {
	// Message is the message that needs custom marshal/unmarshal
	Message *protogen.Message
	// EmptyBehaviorFields are fields with empty_behavior annotation
	EmptyBehaviorFields []*EmptyBehaviorFieldInfo
}

EmptyBehaviorContext holds information about messages that need custom JSON encoding for empty_behavior fields.

type EmptyBehaviorFieldInfo added in v0.6.0

type EmptyBehaviorFieldInfo struct {
	Field    *protogen.Field
	Behavior http.EmptyBehavior
}

EmptyBehaviorFieldInfo holds field info with its empty behavior setting.

type EnumEncodingContext added in v0.6.0

type EnumEncodingContext struct {
	Enum              *protogen.Enum
	HasCustomValues   bool
	HasNumberEncoding bool
}

EnumEncodingContext holds information about enums that need custom JSON encoding.

type FlattenContext added in v0.7.0

type FlattenContext struct {
	// Message is the message that needs custom marshal/unmarshal
	Message *protogen.Message
	// FlattenInfos holds all flatten-annotated fields with their prefixes
	FlattenInfos []*FlattenFieldInfo
}

FlattenContext holds information about messages that need custom JSON encoding for flatten-annotated fields.

type FlattenFieldInfo added in v0.7.0

type FlattenFieldInfo struct {
	Field  *protogen.Field
	Prefix string // flatten_prefix value (may be empty)
}

FlattenFieldInfo holds field info with its flatten prefix.

type Generator

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

Generator handles HTTP client code generation for protobuf services.

func New

func New(plugin *protogen.Plugin) *Generator

New creates a new HTTP client generator.

func (*Generator) Generate

func (g *Generator) Generate() error

Generate processes all files and generates HTTP clients.

type Int64EncodingContext added in v0.6.0

type Int64EncodingContext struct {
	// Message is the message that needs custom marshal/unmarshal
	Message *protogen.Message
	// NumberFields are fields with int64_encoding=NUMBER annotation
	NumberFields []*protogen.Field
}

Int64EncodingContext holds information about messages that need custom JSON encoding for int64/uint64 fields with NUMBER encoding.

type Int64WrapperContext added in v0.10.0

type Int64WrapperContext struct {
	// Message is the wrapper message that needs transitive marshal/unmarshal
	Message *protogen.Message
	// NestedFields are message-type fields whose type has direct NUMBER encoding
	NestedFields []*protogen.Field
}

Int64WrapperContext holds information about messages that contain nested messages with int64 NUMBER encoding — requiring transitive MarshalJSON/UnmarshalJSON.

type NullableContext added in v0.6.0

type NullableContext struct {
	Message        *protogen.Message
	NullableFields []*protogen.Field
}

NullableContext holds information about messages that need custom JSON encoding for nullable primitive fields.

type OneofDiscriminatorContext added in v0.7.0

type OneofDiscriminatorContext struct {
	// Message is the message that needs custom marshal/unmarshal
	Message *protogen.Message
	// Oneofs are the annotated oneof fields with their resolved discriminator info
	Oneofs []*annotations.OneofDiscriminatorInfo
}

OneofDiscriminatorContext holds information about a message that needs custom JSON encoding for oneof fields with discriminator annotations.

type TimestampFormatContext added in v0.7.0

type TimestampFormatContext struct {
	// Message is the message that needs custom marshal/unmarshal
	Message *protogen.Message
	// TimestampFields are fields with timestamp_format annotation (non-default)
	TimestampFields []*TimestampFormatFieldInfo
}

TimestampFormatContext holds information about messages that need custom JSON encoding for Timestamp fields with non-default format annotations.

type TimestampFormatFieldInfo added in v0.7.0

type TimestampFormatFieldInfo struct {
	Field  *protogen.Field
	Format http.TimestampFormat
}

TimestampFormatFieldInfo holds field info with its timestamp format setting.

Jump to

Keyboard shortcuts

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