Documentation ¶
Overview ¶
Package gogoproto provides extensions for protocol buffers to achieve:
- fast marshalling and unmarshalling.
- peace of mind by optionally generating test and benchmark code.
- more canonical Go structures.
- less typing by optionally generating extra helper code.
- goprotobuf compatibility
More Canonical Go Structures ¶
A lot of time working with a goprotobuf struct will lead you to a place where you create another struct that is easier to work with and then have a function to copy the values between the two structs. You might also find that basic structs that started their life as part of an API need to be sent over the wire. With gob, you could just send it. With goprotobuf, you need to make a parallel struct. Gogoprotobuf tries to fix these problems with the nullable, embed, customtype and customname field extensions.
- nullable, if false, a field is generated without a pointer (see warning below).
- embed, if true, the field is generated as an embedded field.
- customtype, It works with the Marshal and Unmarshal methods, to allow you to have your own types in your struct, but marshal to bytes. For example, custom.Uuid or custom.Fixed128
- customname (beta), Changes the generated fieldname. This is especially useful when generated methods conflict with fieldnames.
- casttype (beta), Changes the generated fieldtype. All generated code assumes that this type is castable to the protocol buffer field type. It does not work for structs or enums.
- castkey (beta), Changes the generated fieldtype for a map key. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps.
- castvalue (beta), Changes the generated fieldtype for a map value. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps.
Warning about nullable: According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset.
Let us look at:
github.com/gogo/protobuf/test/example/example.proto
for a quicker overview.
The following message:
package test; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; message A { optional string Description = 1 [(gogoproto.nullable) = false]; optional int64 Number = 2 [(gogoproto.nullable) = false]; optional bytes Id = 3 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uuid", (gogoproto.nullable) = false]; }
Will generate a go struct which looks a lot like this:
type A struct { Description string Number int64 Id github_com_gogo_protobuf_test_custom.Uuid }
You will see there are no pointers, since all fields are non-nullable. You will also see a custom type which marshals to a string. Be warned it is your responsibility to test your custom types thoroughly. You should think of every possible empty and nil case for your marshaling, unmarshaling and size methods.
Next we will embed the message A in message B.
message B { optional A A = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; repeated bytes G = 2 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uint128", (gogoproto.nullable) = false]; }
See below that A is embedded in B.
type B struct { A G []github_com_gogo_protobuf_test_custom.Uint128 }
Also see the repeated custom type.
type Uint128 [2]uint64
Next we will create a custom name for one of our fields.
message C { optional int64 size = 1 [(gogoproto.customname) = "MySize"]; }
See below that the field's name is MySize and not Size.
type C struct { MySize *int64 }
The is useful when having a protocol buffer message with a field name which conflicts with a generated method. As an example, having a field name size and using the sizer plugin to generate a Size method will cause a go compiler error. Using customname you can fix this error without changing the field name. This is typically useful when working with a protocol buffer that was designed before these methods and/or the go language were avialable.
Gogoprotobuf also has some more subtle changes, these could be changed back:
- the generated package name for imports do not have the extra /filename.pb, but are actually the imports specified in the .proto file.
Gogoprotobuf also has lost some features which should be brought back with time:
- Marshalling and unmarshalling with reflect and without the unsafe package, this requires work in pointer_reflect.go
Why does nullable break protocol buffer specifications:
The protocol buffer specification states, somewhere, that you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of protocol buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset.
Goprotobuf Compatibility:
Gogoprotobuf is compatible with Goprotobuf, because it is compatible with protocol buffers. Gogoprotobuf generates the same code as goprotobuf if no extensions are used. The enumprefix, getters and stringer extensions can be used to remove some of the unnecessary code generated by goprotobuf:
- gogoproto_import, if false, the generated code imports github.com/golang/protobuf/proto instead of github.com/gogo/protobuf/proto.
- goproto_enum_prefix, if false, generates the enum constant names without the messagetype prefix
- goproto_enum_stringer (experimental), if false, the enum is generated without the default string method, this is useful for rather using enum_stringer, or allowing you to write your own string method.
- goproto_getters, if false, the message is generated without get methods, this is useful when you would rather want to use face
- goproto_stringer, if false, the message is generated without the default string method, this is useful for rather using stringer, or allowing you to write your own string method.
- goproto_extensions_map (beta), if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension
- goproto_unrecognized (beta), if false, XXX_unrecognized field is not generated. This is useful in conjunction with gogoproto.nullable=false, to generate structures completely devoid of pointers and reduce GC pressure at the cost of losing information about unrecognized fields.
Less Typing and Peace of Mind is explained in their specific plugin folders godoc:
- github.com/gogo/protobuf/plugin/<extension_name>
If you do not use any of these extension the code that is generated will be the same as if goprotobuf has generated it.
The most complete way to see examples is to look at
github.com/gogo/protobuf/test/thetest.proto
Gogoprototest is a seperate project, because we want to keep gogoprotobuf independant of goprotobuf, but we still want to test it thoroughly.
Package gogoproto is a generated protocol buffer package.
It is generated from these files:
gogo.proto
It has these top-level messages:
Index ¶
- Variables
- func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, ...) bool
- func EnabledGoStringer(file *google_protobuf.FileDescriptorProto, ...) bool
- func GetCastKey(field *google_protobuf.FieldDescriptorProto) string
- func GetCastType(field *google_protobuf.FieldDescriptorProto) string
- func GetCastValue(field *google_protobuf.FieldDescriptorProto) string
- func GetCustomName(field *google_protobuf.FieldDescriptorProto) string
- func GetCustomType(field *google_protobuf.FieldDescriptorProto) string
- func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string
- func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string
- func HasBenchGen(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasDescription(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasEqual(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasGoGetters(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasGoString(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasPopulate(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasTestGen(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasUnrecognized(file *google_protobuf.FileDescriptorProto, ...) bool
- func HasVerboseEqual(file *google_protobuf.FileDescriptorProto, ...) bool
- func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool
- func IsCastKey(field *google_protobuf.FieldDescriptorProto) bool
- func IsCastType(field *google_protobuf.FieldDescriptorProto) bool
- func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool
- func IsCustomName(field *google_protobuf.FieldDescriptorProto) bool
- func IsCustomType(field *google_protobuf.FieldDescriptorProto) bool
- func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool
- func IsEnumStringer(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsFace(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsMarshaler(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsNullable(field *google_protobuf.FieldDescriptorProto) bool
- func IsProto3(file *google_protobuf.FileDescriptorProto) bool
- func IsProtoSizer(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsSizer(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsStringer(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsUnion(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsUnmarshaler(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsUnsafeMarshaler(file *google_protobuf.FileDescriptorProto, ...) bool
- func IsUnsafeUnmarshaler(file *google_protobuf.FileDescriptorProto, ...) bool
- type EnableFunc
Constants ¶
This section is empty.
Variables ¶
var E_Benchgen = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64016, Name: "gogoproto.benchgen", Tag: "varint,64016,opt,name=benchgen", }
var E_BenchgenAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63016, Name: "gogoproto.benchgen_all", Tag: "varint,63016,opt,name=benchgen_all", }
var E_Castkey = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65008, Name: "gogoproto.castkey", Tag: "bytes,65008,opt,name=castkey", }
var E_Casttype = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65007, Name: "gogoproto.casttype", Tag: "bytes,65007,opt,name=casttype", }
var E_Castvalue = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65009, Name: "gogoproto.castvalue", Tag: "bytes,65009,opt,name=castvalue", }
var E_Customname = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65004, Name: "gogoproto.customname", Tag: "bytes,65004,opt,name=customname", }
var E_Customtype = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65003, Name: "gogoproto.customtype", Tag: "bytes,65003,opt,name=customtype", }
var E_Description = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64014, Name: "gogoproto.description", Tag: "varint,64014,opt,name=description", }
var E_DescriptionAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63014, Name: "gogoproto.description_all", Tag: "varint,63014,opt,name=description_all", }
var E_Embed = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 65002, Name: "gogoproto.embed", Tag: "varint,65002,opt,name=embed", }
var E_EnumStringer = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.EnumOptions)(nil), ExtensionType: (*bool)(nil), Field: 62022, Name: "gogoproto.enum_stringer", Tag: "varint,62022,opt,name=enum_stringer", }
var E_EnumStringerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63022, Name: "gogoproto.enum_stringer_all", Tag: "varint,63022,opt,name=enum_stringer_all", }
var E_Equal = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64013, Name: "gogoproto.equal", Tag: "varint,64013,opt,name=equal", }
var E_EqualAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63013, Name: "gogoproto.equal_all", Tag: "varint,63013,opt,name=equal_all", }
var E_Face = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64005, Name: "gogoproto.face", Tag: "varint,64005,opt,name=face", }
var E_FaceAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63005, Name: "gogoproto.face_all", Tag: "varint,63005,opt,name=face_all", }
var E_GogoprotoImport = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63027, Name: "gogoproto.gogoproto_import", Tag: "varint,63027,opt,name=gogoproto_import", }
var E_GoprotoEnumPrefix = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.EnumOptions)(nil), ExtensionType: (*bool)(nil), Field: 62001, Name: "gogoproto.goproto_enum_prefix", Tag: "varint,62001,opt,name=goproto_enum_prefix", }
var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63002, Name: "gogoproto.goproto_enum_prefix_all", Tag: "varint,63002,opt,name=goproto_enum_prefix_all", }
var E_GoprotoEnumStringer = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.EnumOptions)(nil), ExtensionType: (*bool)(nil), Field: 62021, Name: "gogoproto.goproto_enum_stringer", Tag: "varint,62021,opt,name=goproto_enum_stringer", }
var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63021, Name: "gogoproto.goproto_enum_stringer_all", Tag: "varint,63021,opt,name=goproto_enum_stringer_all", }
var E_GoprotoExtensionsMap = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64025, Name: "gogoproto.goproto_extensions_map", Tag: "varint,64025,opt,name=goproto_extensions_map", }
var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63025, Name: "gogoproto.goproto_extensions_map_all", Tag: "varint,63025,opt,name=goproto_extensions_map_all", }
var E_GoprotoGetters = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64001, Name: "gogoproto.goproto_getters", Tag: "varint,64001,opt,name=goproto_getters", }
var E_GoprotoGettersAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63001, Name: "gogoproto.goproto_getters_all", Tag: "varint,63001,opt,name=goproto_getters_all", }
var E_GoprotoStringer = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64003, Name: "gogoproto.goproto_stringer", Tag: "varint,64003,opt,name=goproto_stringer", }
var E_GoprotoStringerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63003, Name: "gogoproto.goproto_stringer_all", Tag: "varint,63003,opt,name=goproto_stringer_all", }
var E_GoprotoUnrecognized = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64026, Name: "gogoproto.goproto_unrecognized", Tag: "varint,64026,opt,name=goproto_unrecognized", }
var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63026, Name: "gogoproto.goproto_unrecognized_all", Tag: "varint,63026,opt,name=goproto_unrecognized_all", }
var E_Gostring = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64006, Name: "gogoproto.gostring", Tag: "varint,64006,opt,name=gostring", }
var E_GostringAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63006, Name: "gogoproto.gostring_all", Tag: "varint,63006,opt,name=gostring_all", }
var E_Jsontag = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65005, Name: "gogoproto.jsontag", Tag: "bytes,65005,opt,name=jsontag", }
var E_Marshaler = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64017, Name: "gogoproto.marshaler", Tag: "varint,64017,opt,name=marshaler", }
var E_MarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63017, Name: "gogoproto.marshaler_all", Tag: "varint,63017,opt,name=marshaler_all", }
google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65006, Name: "gogoproto.moretags", Tag: "bytes,65006,opt,name=moretags", }ExtendedType: (*
var E_Nullable = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 65001, Name: "gogoproto.nullable", Tag: "varint,65001,opt,name=nullable", }
var E_Onlyone = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64009, Name: "gogoproto.onlyone", Tag: "varint,64009,opt,name=onlyone", }
var E_OnlyoneAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63009, Name: "gogoproto.onlyone_all", Tag: "varint,63009,opt,name=onlyone_all", }
var E_Populate = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64007, Name: "gogoproto.populate", Tag: "varint,64007,opt,name=populate", }
var E_PopulateAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63007, Name: "gogoproto.populate_all", Tag: "varint,63007,opt,name=populate_all", }
var E_Protosizer = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64028, Name: "gogoproto.protosizer", Tag: "varint,64028,opt,name=protosizer", }
var E_ProtosizerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63028, Name: "gogoproto.protosizer_all", Tag: "varint,63028,opt,name=protosizer_all", }
var E_Sizer = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64020, Name: "gogoproto.sizer", Tag: "varint,64020,opt,name=sizer", }
var E_SizerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63020, Name: "gogoproto.sizer_all", Tag: "varint,63020,opt,name=sizer_all", }
var E_Stringer = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 67008, Name: "gogoproto.stringer", Tag: "varint,67008,opt,name=stringer", }
var E_StringerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63008, Name: "gogoproto.stringer_all", Tag: "varint,63008,opt,name=stringer_all", }
var E_Testgen = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64015, Name: "gogoproto.testgen", Tag: "varint,64015,opt,name=testgen", }
var E_TestgenAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63015, Name: "gogoproto.testgen_all", Tag: "varint,63015,opt,name=testgen_all", }
var E_Unmarshaler = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64018, Name: "gogoproto.unmarshaler", Tag: "varint,64018,opt,name=unmarshaler", }
var E_UnmarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63018, Name: "gogoproto.unmarshaler_all", Tag: "varint,63018,opt,name=unmarshaler_all", }
var E_UnsafeMarshaler = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64023, Name: "gogoproto.unsafe_marshaler", Tag: "varint,64023,opt,name=unsafe_marshaler", }
var E_UnsafeMarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63023, Name: "gogoproto.unsafe_marshaler_all", Tag: "varint,63023,opt,name=unsafe_marshaler_all", }
var E_UnsafeUnmarshaler = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64024, Name: "gogoproto.unsafe_unmarshaler", Tag: "varint,64024,opt,name=unsafe_unmarshaler", }
var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63024, Name: "gogoproto.unsafe_unmarshaler_all", Tag: "varint,63024,opt,name=unsafe_unmarshaler_all", }
var E_VerboseEqual = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64004, Name: "gogoproto.verbose_equal", Tag: "varint,64004,opt,name=verbose_equal", }
var E_VerboseEqualAll = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63004, Name: "gogoproto.verbose_equal_all", Tag: "varint,63004,opt,name=verbose_equal_all", }
Functions ¶
func EnabledGoEnumPrefix ¶
func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool
func EnabledGoStringer ¶
func EnabledGoStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func GetCastKey ¶
func GetCastKey(field *google_protobuf.FieldDescriptorProto) string
func GetCastType ¶
func GetCastType(field *google_protobuf.FieldDescriptorProto) string
func GetCastValue ¶
func GetCastValue(field *google_protobuf.FieldDescriptorProto) string
func GetCustomName ¶
func GetCustomName(field *google_protobuf.FieldDescriptorProto) string
func GetCustomType ¶
func GetCustomType(field *google_protobuf.FieldDescriptorProto) string
func GetJsonTag ¶
func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string
func GetMoreTags ¶
func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string
func HasBenchGen ¶
func HasBenchGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasDescription ¶
func HasDescription(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasEqual ¶
func HasEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasExtensionsMap ¶
func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasGoGetters ¶
func HasGoGetters(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasGoString ¶
func HasGoString(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasPopulate ¶
func HasPopulate(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasTestGen ¶
func HasTestGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasUnrecognized ¶
func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func HasVerboseEqual ¶
func HasVerboseEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func ImportsGoGoProto ¶
func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool
func IsCastKey ¶
func IsCastKey(field *google_protobuf.FieldDescriptorProto) bool
func IsCastType ¶
func IsCastType(field *google_protobuf.FieldDescriptorProto) bool
func IsCastValue ¶
func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool
func IsCustomName ¶
func IsCustomName(field *google_protobuf.FieldDescriptorProto) bool
func IsCustomType ¶
func IsCustomType(field *google_protobuf.FieldDescriptorProto) bool
func IsEmbed ¶
func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool
func IsEnumStringer ¶
func IsEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool
func IsFace ¶
func IsFace(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsGoEnumStringer ¶
func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool
func IsMarshaler ¶
func IsMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsNullable ¶
func IsNullable(field *google_protobuf.FieldDescriptorProto) bool
func IsProto3 ¶
func IsProto3(file *google_protobuf.FileDescriptorProto) bool
func IsProtoSizer ¶
func IsProtoSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsSizer ¶
func IsSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsStringer ¶
func IsStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsUnion ¶
func IsUnion(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsUnmarshaler ¶
func IsUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsUnsafeMarshaler ¶
func IsUnsafeMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
func IsUnsafeUnmarshaler ¶
func IsUnsafeUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
Types ¶
type EnableFunc ¶
type EnableFunc func(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool