Documentation
¶
Index ¶
- type BytesEncodingContext
- type BytesEncodingFieldInfo
- type EmptyBehaviorContext
- type EmptyBehaviorFieldInfo
- type EnumEncodingContext
- type FlattenContext
- type FlattenFieldInfo
- type Generator
- type Int64EncodingContext
- type Int64WrapperContext
- type NullableContext
- type OneofDiscriminatorContext
- type TimestampFormatContext
- type TimestampFormatFieldInfo
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
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.
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
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.