Documentation ¶
Index ¶
- func Generate(request *pluginpb.CodeGeneratorRequest, opts Options) (*pluginpb.CodeGeneratorResponse, error)
- func IsTypeLong(field protoreflect.FieldDescriptor) bool
- func IsWellKnownType(desc protoreflect.Descriptor) bool
- func IsWellKnownTypeLong(wkt WellKnown) bool
- func TextToCase(text, textcase string) string
- type Options
- type Type
- type WellKnown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(request *pluginpb.CodeGeneratorRequest, opts Options) (*pluginpb.CodeGeneratorResponse, error)
func IsTypeLong ¶
func IsTypeLong(field protoreflect.FieldDescriptor) bool
func IsWellKnownType ¶
func IsWellKnownType(desc protoreflect.Descriptor) bool
func IsWellKnownTypeLong ¶
Check is WellKnownInt64Value or WellKnownUInt64Value type.
func TextToCase ¶
Types ¶
type Options ¶
type Options struct { // UseProtoNames controls the casing of generated field names. // If set to true, fields will use proto names (typically snake_case). // If omitted or set to false, fields will use JSON names (typically camelCase). UseProtoNames bool // UseEnumNumbers emits enum values as numbers. UseEnumNumbers bool // The method names of service methods naming case. // Only work when `UseEnumNumbers=true` // opt: // camelcase: convert name to lower camel case like `camelCase` // pascalcase: convert name to pascalcase like `PascalCase` // default is pascalcase EnumFieldNaming string // Generate comments as multiline comments. UseMultiLineComment bool // force add `undefined` to message field. // default true ForceMessageFieldUndefinable bool // If set to true, body will be JSON.stringify before send // default true UseBodyStringify bool // The method names of service methods naming case. // opt: // camelcase: convert name to lower camel case like `camelCase` // pascalcase: convert name to pascalcase like `PascalCase` // default is pascalcase ServiceMethodNaming string // If set to true, field int64 and uint64 will convert to string ForceLongAsString bool }
type WellKnown ¶
type WellKnown string
const ( WellKnownAny WellKnown = "google.protobuf.Any" WellKnownDuration WellKnown = "google.protobuf.Duration" WellKnownEmpty WellKnown = "google.protobuf.Empty" WellKnownFieldMask WellKnown = "google.protobuf.FieldMask" WellKnownStruct WellKnown = "google.protobuf.Struct" WellKnownTimestamp WellKnown = "google.protobuf.Timestamp" // Wrapper types. WellKnownFloatValue WellKnown = "google.protobuf.FloatValue" WellKnownInt64Value WellKnown = "google.protobuf.Int64Value" WellKnownInt32Value WellKnown = "google.protobuf.Int32Value" WellKnownUInt64Value WellKnown = "google.protobuf.UInt64Value" WellKnownUInt32Value WellKnown = "google.protobuf.UInt32Value" WellKnownBytesValue WellKnown = "google.protobuf.BytesValue" WellKnownDoubleValue WellKnown = "google.protobuf.DoubleValue" WellKnownBoolValue WellKnown = "google.protobuf.BoolValue" WellKnownStringValue WellKnown = "google.protobuf.StringValue" // Descriptor types. WellKnownValue WellKnown = "google.protobuf.Value" WellKnownNullValue WellKnown = "google.protobuf.NullValue" WellKnownListValue WellKnown = "google.protobuf.ListValue" )
https://developers.google.com/protocol-buffers/docs/reference/google.protobuf
func WellKnownType ¶
func WellKnownType(desc protoreflect.Descriptor) (WellKnown, bool)
func (WellKnown) TypeDeclaration ¶
Click to show internal directories.
Click to hide internal directories.