Documentation
¶
Index ¶
- Constants
- Variables
- type DescriptorSize
- type FieldType
- type IntSize
- type NanoPBOptions
- func (x *NanoPBOptions) ClearAnonymousOneof()
- func (x *NanoPBOptions) ClearCallbackDatatype()
- func (x *NanoPBOptions) ClearCallbackFunction()
- func (x *NanoPBOptions) ClearDefaultHas()
- func (x *NanoPBOptions) ClearDescriptorsize()
- func (x *NanoPBOptions) ClearEnumToString()
- func (x *NanoPBOptions) ClearFallbackType()
- func (x *NanoPBOptions) ClearFixedCount()
- func (x *NanoPBOptions) ClearFixedLength()
- func (x *NanoPBOptions) ClearIntSize()
- func (x *NanoPBOptions) ClearLongNames()
- func (x *NanoPBOptions) ClearMangleNames()
- func (x *NanoPBOptions) ClearMaxCount()
- func (x *NanoPBOptions) ClearMaxLength()
- func (x *NanoPBOptions) ClearMaxSize()
- func (x *NanoPBOptions) ClearMsgid()
- func (x *NanoPBOptions) ClearNoUnions()
- func (x *NanoPBOptions) ClearPackage()
- func (x *NanoPBOptions) ClearPackedEnum()
- func (x *NanoPBOptions) ClearPackedStruct()
- func (x *NanoPBOptions) ClearProto3()
- func (x *NanoPBOptions) ClearProto3SingularMsgs()
- func (x *NanoPBOptions) ClearSkipMessage()
- func (x *NanoPBOptions) ClearSortByTag()
- func (x *NanoPBOptions) ClearSubmsgCallback()
- func (x *NanoPBOptions) ClearType()
- func (x *NanoPBOptions) ClearTypeOverride()
- func (x *NanoPBOptions) GetAnonymousOneof() bool
- func (x *NanoPBOptions) GetCallbackDatatype() string
- func (x *NanoPBOptions) GetCallbackFunction() string
- func (x *NanoPBOptions) GetDefaultHas() bool
- func (x *NanoPBOptions) GetDescriptorsize() DescriptorSize
- func (x *NanoPBOptions) GetEnumToString() bool
- func (x *NanoPBOptions) GetExclude() []string
- func (x *NanoPBOptions) GetFallbackType() FieldType
- func (x *NanoPBOptions) GetFixedCount() bool
- func (x *NanoPBOptions) GetFixedLength() bool
- func (x *NanoPBOptions) GetInclude() []string
- func (x *NanoPBOptions) GetIntSize() IntSize
- func (x *NanoPBOptions) GetLongNames() bool
- func (x *NanoPBOptions) GetMangleNames() TypenameMangling
- func (x *NanoPBOptions) GetMaxCount() int32
- func (x *NanoPBOptions) GetMaxLength() int32
- func (x *NanoPBOptions) GetMaxSize() int32
- func (x *NanoPBOptions) GetMsgid() uint32
- func (x *NanoPBOptions) GetNoUnions() bool
- func (x *NanoPBOptions) GetPackage() string
- func (x *NanoPBOptions) GetPackedEnum() bool
- func (x *NanoPBOptions) GetPackedStruct() bool
- func (x *NanoPBOptions) GetProto3() bool
- func (x *NanoPBOptions) GetProto3SingularMsgs() bool
- func (x *NanoPBOptions) GetSkipMessage() bool
- func (x *NanoPBOptions) GetSortByTag() bool
- func (x *NanoPBOptions) GetSubmsgCallback() bool
- func (x *NanoPBOptions) GetType() FieldType
- func (x *NanoPBOptions) GetTypeOverride() descriptorpb.FieldDescriptorProto_Type
- func (x *NanoPBOptions) HasAnonymousOneof() bool
- func (x *NanoPBOptions) HasCallbackDatatype() bool
- func (x *NanoPBOptions) HasCallbackFunction() bool
- func (x *NanoPBOptions) HasDefaultHas() bool
- func (x *NanoPBOptions) HasDescriptorsize() bool
- func (x *NanoPBOptions) HasEnumToString() bool
- func (x *NanoPBOptions) HasFallbackType() bool
- func (x *NanoPBOptions) HasFixedCount() bool
- func (x *NanoPBOptions) HasFixedLength() bool
- func (x *NanoPBOptions) HasIntSize() bool
- func (x *NanoPBOptions) HasLongNames() bool
- func (x *NanoPBOptions) HasMangleNames() bool
- func (x *NanoPBOptions) HasMaxCount() bool
- func (x *NanoPBOptions) HasMaxLength() bool
- func (x *NanoPBOptions) HasMaxSize() bool
- func (x *NanoPBOptions) HasMsgid() bool
- func (x *NanoPBOptions) HasNoUnions() bool
- func (x *NanoPBOptions) HasPackage() bool
- func (x *NanoPBOptions) HasPackedEnum() bool
- func (x *NanoPBOptions) HasPackedStruct() bool
- func (x *NanoPBOptions) HasProto3() bool
- func (x *NanoPBOptions) HasProto3SingularMsgs() bool
- func (x *NanoPBOptions) HasSkipMessage() bool
- func (x *NanoPBOptions) HasSortByTag() bool
- func (x *NanoPBOptions) HasSubmsgCallback() bool
- func (x *NanoPBOptions) HasType() bool
- func (x *NanoPBOptions) HasTypeOverride() bool
- func (*NanoPBOptions) ProtoMessage()
- func (x *NanoPBOptions) ProtoReflect() protoreflect.Message
- func (x *NanoPBOptions) Reset()
- func (x *NanoPBOptions) SetAnonymousOneof(v bool)
- func (x *NanoPBOptions) SetCallbackDatatype(v string)
- func (x *NanoPBOptions) SetCallbackFunction(v string)
- func (x *NanoPBOptions) SetDefaultHas(v bool)
- func (x *NanoPBOptions) SetDescriptorsize(v DescriptorSize)
- func (x *NanoPBOptions) SetEnumToString(v bool)
- func (x *NanoPBOptions) SetExclude(v []string)
- func (x *NanoPBOptions) SetFallbackType(v FieldType)
- func (x *NanoPBOptions) SetFixedCount(v bool)
- func (x *NanoPBOptions) SetFixedLength(v bool)
- func (x *NanoPBOptions) SetInclude(v []string)
- func (x *NanoPBOptions) SetIntSize(v IntSize)
- func (x *NanoPBOptions) SetLongNames(v bool)
- func (x *NanoPBOptions) SetMangleNames(v TypenameMangling)
- func (x *NanoPBOptions) SetMaxCount(v int32)
- func (x *NanoPBOptions) SetMaxLength(v int32)
- func (x *NanoPBOptions) SetMaxSize(v int32)
- func (x *NanoPBOptions) SetMsgid(v uint32)
- func (x *NanoPBOptions) SetNoUnions(v bool)
- func (x *NanoPBOptions) SetPackage(v string)
- func (x *NanoPBOptions) SetPackedEnum(v bool)
- func (x *NanoPBOptions) SetPackedStruct(v bool)
- func (x *NanoPBOptions) SetProto3(v bool)
- func (x *NanoPBOptions) SetProto3SingularMsgs(v bool)
- func (x *NanoPBOptions) SetSkipMessage(v bool)
- func (x *NanoPBOptions) SetSortByTag(v bool)
- func (x *NanoPBOptions) SetSubmsgCallback(v bool)
- func (x *NanoPBOptions) SetType(v FieldType)
- func (x *NanoPBOptions) SetTypeOverride(v descriptorpb.FieldDescriptorProto_Type)
- func (x *NanoPBOptions) String() string
- type NanoPBOptions_builder
- type TypenameMangling
Constants ¶
View Source
const ( Default_NanoPBOptions_IntSize = IntSize_IS_DEFAULT Default_NanoPBOptions_Type = FieldType_FT_DEFAULT Default_NanoPBOptions_LongNames = bool(true) Default_NanoPBOptions_PackedStruct = bool(false) Default_NanoPBOptions_PackedEnum = bool(false) Default_NanoPBOptions_SkipMessage = bool(false) Default_NanoPBOptions_NoUnions = bool(false) Default_NanoPBOptions_AnonymousOneof = bool(false) Default_NanoPBOptions_Proto3 = bool(false) Default_NanoPBOptions_Proto3SingularMsgs = bool(false) Default_NanoPBOptions_EnumToString = bool(false) Default_NanoPBOptions_FixedLength = bool(false) Default_NanoPBOptions_FixedCount = bool(false) Default_NanoPBOptions_SubmsgCallback = bool(false) Default_NanoPBOptions_MangleNames = TypenameMangling_M_NONE Default_NanoPBOptions_CallbackDatatype = string("pb_callback_t") Default_NanoPBOptions_CallbackFunction = string("pb_default_field_callback") Default_NanoPBOptions_Descriptorsize = DescriptorSize_DS_AUTO Default_NanoPBOptions_DefaultHas = bool(false) Default_NanoPBOptions_SortByTag = bool(true) Default_NanoPBOptions_FallbackType = FieldType_FT_CALLBACK )
Default values for NanoPBOptions fields.
Variables ¶
View Source
var ( FieldType_name = map[int32]string{ 0: "FT_DEFAULT", 1: "FT_CALLBACK", 4: "FT_POINTER", 2: "FT_STATIC", 3: "FT_IGNORE", 5: "FT_INLINE", } FieldType_value = map[string]int32{ "FT_DEFAULT": 0, "FT_CALLBACK": 1, "FT_POINTER": 4, "FT_STATIC": 2, "FT_IGNORE": 3, "FT_INLINE": 5, } )
Enum value maps for FieldType.
View Source
var ( IntSize_name = map[int32]string{ 0: "IS_DEFAULT", 8: "IS_8", 16: "IS_16", 32: "IS_32", 64: "IS_64", } IntSize_value = map[string]int32{ "IS_DEFAULT": 0, "IS_8": 8, "IS_16": 16, "IS_32": 32, "IS_64": 64, } )
Enum value maps for IntSize.
View Source
var ( TypenameMangling_name = map[int32]string{ 0: "M_NONE", 1: "M_STRIP_PACKAGE", 2: "M_FLATTEN", 3: "M_PACKAGE_INITIALS", } TypenameMangling_value = map[string]int32{ "M_NONE": 0, "M_STRIP_PACKAGE": 1, "M_FLATTEN": 2, "M_PACKAGE_INITIALS": 3, } )
Enum value maps for TypenameMangling.
View Source
var ( DescriptorSize_name = map[int32]string{ 0: "DS_AUTO", 1: "DS_1", 2: "DS_2", 4: "DS_4", 8: "DS_8", } DescriptorSize_value = map[string]int32{ "DS_AUTO": 0, "DS_1": 1, "DS_2": 2, "DS_4": 4, "DS_8": 8, } )
Enum value maps for DescriptorSize.
View Source
var (
// optional NanoPBOptions nanopb = 1010;
E_Nanopb = &file_nanopb_proto_extTypes[3]
)
Extension fields to descriptorpb.FieldOptions.
View Source
var (
// optional NanoPBOptions nanopb_enumopt = 1010;
E_NanopbEnumopt = &file_nanopb_proto_extTypes[2]
)
Extension fields to descriptorpb.EnumOptions.
View Source
var (
// optional NanoPBOptions nanopb_fileopt = 1010;
E_NanopbFileopt = &file_nanopb_proto_extTypes[0]
)
Extension fields to descriptorpb.FileOptions.
View Source
var (
// optional NanoPBOptions nanopb_msgopt = 1010;
E_NanopbMsgopt = &file_nanopb_proto_extTypes[1]
)
Extension fields to descriptorpb.MessageOptions.
View Source
var File_nanopb_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type DescriptorSize ¶
type DescriptorSize int32
const ( DescriptorSize_DS_AUTO DescriptorSize = 0 // Select minimal size based on field type DescriptorSize_DS_1 DescriptorSize = 1 // 1 word; up to 15 byte fields, no arrays DescriptorSize_DS_2 DescriptorSize = 2 // 2 words; up to 4095 byte fields, 4095 entry arrays DescriptorSize_DS_4 DescriptorSize = 4 // 4 words; up to 2^32-1 byte fields, 2^16-1 entry arrays DescriptorSize_DS_8 DescriptorSize = 8 // 8 words; up to 2^32-1 entry arrays )
func (DescriptorSize) Descriptor ¶
func (DescriptorSize) Descriptor() protoreflect.EnumDescriptor
func (DescriptorSize) Enum ¶
func (x DescriptorSize) Enum() *DescriptorSize
func (DescriptorSize) Number ¶
func (x DescriptorSize) Number() protoreflect.EnumNumber
func (DescriptorSize) String ¶
func (x DescriptorSize) String() string
func (DescriptorSize) Type ¶
func (DescriptorSize) Type() protoreflect.EnumType
type FieldType ¶
type FieldType int32
const ( FieldType_FT_DEFAULT FieldType = 0 // Automatically decide field type, generate static field if possible. FieldType_FT_CALLBACK FieldType = 1 // Always generate a callback field. FieldType_FT_POINTER FieldType = 4 // Always generate a dynamically allocated field. FieldType_FT_STATIC FieldType = 2 // Generate a static field or raise an exception if not possible. FieldType_FT_IGNORE FieldType = 3 // Ignore the field completely. FieldType_FT_INLINE FieldType = 5 // Legacy option, use the separate 'fixed_length' option instead )
func (FieldType) Descriptor ¶
func (FieldType) Descriptor() protoreflect.EnumDescriptor
func (FieldType) Number ¶
func (x FieldType) Number() protoreflect.EnumNumber
func (FieldType) Type ¶
func (FieldType) Type() protoreflect.EnumType
type IntSize ¶
type IntSize int32
func (IntSize) Descriptor ¶
func (IntSize) Descriptor() protoreflect.EnumDescriptor
func (IntSize) Number ¶
func (x IntSize) Number() protoreflect.EnumNumber
func (IntSize) Type ¶
func (IntSize) Type() protoreflect.EnumType
type NanoPBOptions ¶
type NanoPBOptions struct {
// Allocated size for 'bytes' and 'string' fields.
// For string fields, this should include the space for null terminator.
MaxSize *int32 `protobuf:"varint,1,opt,name=max_size,json=maxSize" json:"max_size,omitempty"`
// Maximum length for 'string' fields. Setting this is equivalent
// to setting max_size to a value of length+1.
MaxLength *int32 `protobuf:"varint,14,opt,name=max_length,json=maxLength" json:"max_length,omitempty"`
// Allocated number of entries in arrays ('repeated' fields)
MaxCount *int32 `protobuf:"varint,2,opt,name=max_count,json=maxCount" json:"max_count,omitempty"`
// Size of integer fields. Can save some memory if you don't need
// full 32 bits for the value.
IntSize *IntSize `protobuf:"varint,7,opt,name=int_size,json=intSize,enum=IntSize,def=0" json:"int_size,omitempty"`
// Force type of field (callback or static allocation)
Type *FieldType `protobuf:"varint,3,opt,name=type,enum=FieldType,def=0" json:"type,omitempty"`
// Use long names for enums, i.e. EnumName_EnumValue.
LongNames *bool `protobuf:"varint,4,opt,name=long_names,json=longNames,def=1" json:"long_names,omitempty"`
// Add 'packed' attribute to generated structs.
// Note: this cannot be used on CPUs that break on unaligned
// accesses to variables.
PackedStruct *bool `protobuf:"varint,5,opt,name=packed_struct,json=packedStruct,def=0" json:"packed_struct,omitempty"`
// Add 'packed' attribute to generated enums.
PackedEnum *bool `protobuf:"varint,10,opt,name=packed_enum,json=packedEnum,def=0" json:"packed_enum,omitempty"`
// Skip this message
SkipMessage *bool `protobuf:"varint,6,opt,name=skip_message,json=skipMessage,def=0" json:"skip_message,omitempty"`
// Generate oneof fields as normal optional fields instead of union.
NoUnions *bool `protobuf:"varint,8,opt,name=no_unions,json=noUnions,def=0" json:"no_unions,omitempty"`
// integer type tag for a message
Msgid *uint32 `protobuf:"varint,9,opt,name=msgid" json:"msgid,omitempty"`
// decode oneof as anonymous union
AnonymousOneof *bool `protobuf:"varint,11,opt,name=anonymous_oneof,json=anonymousOneof,def=0" json:"anonymous_oneof,omitempty"`
// Proto3 singular field does not generate a "has_" flag
Proto3 *bool `protobuf:"varint,12,opt,name=proto3,def=0" json:"proto3,omitempty"`
// Force proto3 messages to have no "has_" flag.
// This was default behavior until nanopb-0.4.0.
Proto3SingularMsgs *bool `protobuf:"varint,21,opt,name=proto3_singular_msgs,json=proto3SingularMsgs,def=0" json:"proto3_singular_msgs,omitempty"`
// Generate an enum->string mapping function (can take up lots of space).
EnumToString *bool `protobuf:"varint,13,opt,name=enum_to_string,json=enumToString,def=0" json:"enum_to_string,omitempty"`
// Generate bytes arrays with fixed length
FixedLength *bool `protobuf:"varint,15,opt,name=fixed_length,json=fixedLength,def=0" json:"fixed_length,omitempty"`
// Generate repeated field with fixed count
FixedCount *bool `protobuf:"varint,16,opt,name=fixed_count,json=fixedCount,def=0" json:"fixed_count,omitempty"`
// Generate message-level callback that is called before decoding submessages.
// This can be used to set callback fields for submsgs inside oneofs.
SubmsgCallback *bool `protobuf:"varint,22,opt,name=submsg_callback,json=submsgCallback,def=0" json:"submsg_callback,omitempty"`
// Shorten or remove package names from type names.
// This option applies only on the file level.
MangleNames *TypenameMangling `protobuf:"varint,17,opt,name=mangle_names,json=mangleNames,enum=TypenameMangling,def=0" json:"mangle_names,omitempty"`
// Data type for storage associated with callback fields.
CallbackDatatype *string `protobuf:"bytes,18,opt,name=callback_datatype,json=callbackDatatype,def=pb_callback_t" json:"callback_datatype,omitempty"`
// Callback function used for encoding and decoding.
// Prior to nanopb-0.4.0, the callback was specified in per-field pb_callback_t
// structure. This is still supported, but does not work inside e.g. oneof or pointer
// fields. Instead, a new method allows specifying a per-message callback that
// will be called for all callback fields in a message type.
CallbackFunction *string `` /* 133-byte string literal not displayed */
// Select the size of field descriptors. This option has to be defined
// for the whole message, not per-field. Usually automatic selection is
// ok, but if it results in compilation errors you can increase the field
// size here.
Descriptorsize *DescriptorSize `protobuf:"varint,20,opt,name=descriptorsize,enum=DescriptorSize,def=0" json:"descriptorsize,omitempty"`
// Set default value for has_ fields.
DefaultHas *bool `protobuf:"varint,23,opt,name=default_has,json=defaultHas,def=0" json:"default_has,omitempty"`
// Extra files to include in generated `.pb.h`
Include []string `protobuf:"bytes,24,rep,name=include" json:"include,omitempty"`
// Automatic includes to exclude from generated `.pb.h`
// Same as nanopb_generator.py command line flag -x.
Exclude []string `protobuf:"bytes,26,rep,name=exclude" json:"exclude,omitempty"`
// Package name that applies only for nanopb.
Package *string `protobuf:"bytes,25,opt,name=package" json:"package,omitempty"`
// Override type of the field in generated C code. Only to be used with related field types
TypeOverride *descriptorpb.FieldDescriptorProto_Type `` /* 139-byte string literal not displayed */
// Due to historical reasons, nanopb orders fields in structs by their tag number
// instead of the order in .proto. Set this to false to keep the .proto order.
// The default value will probably change to false in nanopb-0.5.0.
SortByTag *bool `protobuf:"varint,28,opt,name=sort_by_tag,json=sortByTag,def=1" json:"sort_by_tag,omitempty"`
// Set the FT_DEFAULT field conversion strategy.
// A field that can become a static member of a c struct (e.g. int, bool, etc)
// will be a a static field.
// Fields with dynamic length are converted to either a pointer or a callback.
FallbackType *FieldType `protobuf:"varint,29,opt,name=fallback_type,json=fallbackType,enum=FieldType,def=1" json:"fallback_type,omitempty"`
// contains filtered or unexported fields
}
This is the inner options message, which basically defines options for a field. When it is used in message or file scope, it applies to all fields.
func (*NanoPBOptions) ClearAnonymousOneof ¶
func (x *NanoPBOptions) ClearAnonymousOneof()
func (*NanoPBOptions) ClearCallbackDatatype ¶
func (x *NanoPBOptions) ClearCallbackDatatype()
func (*NanoPBOptions) ClearCallbackFunction ¶
func (x *NanoPBOptions) ClearCallbackFunction()
func (*NanoPBOptions) ClearDefaultHas ¶
func (x *NanoPBOptions) ClearDefaultHas()
func (*NanoPBOptions) ClearDescriptorsize ¶
func (x *NanoPBOptions) ClearDescriptorsize()
func (*NanoPBOptions) ClearEnumToString ¶
func (x *NanoPBOptions) ClearEnumToString()
func (*NanoPBOptions) ClearFallbackType ¶
func (x *NanoPBOptions) ClearFallbackType()
func (*NanoPBOptions) ClearFixedCount ¶
func (x *NanoPBOptions) ClearFixedCount()
func (*NanoPBOptions) ClearFixedLength ¶
func (x *NanoPBOptions) ClearFixedLength()
func (*NanoPBOptions) ClearIntSize ¶
func (x *NanoPBOptions) ClearIntSize()
func (*NanoPBOptions) ClearLongNames ¶
func (x *NanoPBOptions) ClearLongNames()
func (*NanoPBOptions) ClearMangleNames ¶
func (x *NanoPBOptions) ClearMangleNames()
func (*NanoPBOptions) ClearMaxCount ¶
func (x *NanoPBOptions) ClearMaxCount()
func (*NanoPBOptions) ClearMaxLength ¶
func (x *NanoPBOptions) ClearMaxLength()
func (*NanoPBOptions) ClearMaxSize ¶
func (x *NanoPBOptions) ClearMaxSize()
func (*NanoPBOptions) ClearMsgid ¶
func (x *NanoPBOptions) ClearMsgid()
func (*NanoPBOptions) ClearNoUnions ¶
func (x *NanoPBOptions) ClearNoUnions()
func (*NanoPBOptions) ClearPackage ¶
func (x *NanoPBOptions) ClearPackage()
func (*NanoPBOptions) ClearPackedEnum ¶
func (x *NanoPBOptions) ClearPackedEnum()
func (*NanoPBOptions) ClearPackedStruct ¶
func (x *NanoPBOptions) ClearPackedStruct()
func (*NanoPBOptions) ClearProto3 ¶
func (x *NanoPBOptions) ClearProto3()
func (*NanoPBOptions) ClearProto3SingularMsgs ¶
func (x *NanoPBOptions) ClearProto3SingularMsgs()
func (*NanoPBOptions) ClearSkipMessage ¶
func (x *NanoPBOptions) ClearSkipMessage()
func (*NanoPBOptions) ClearSortByTag ¶
func (x *NanoPBOptions) ClearSortByTag()
func (*NanoPBOptions) ClearSubmsgCallback ¶
func (x *NanoPBOptions) ClearSubmsgCallback()
func (*NanoPBOptions) ClearType ¶
func (x *NanoPBOptions) ClearType()
func (*NanoPBOptions) ClearTypeOverride ¶
func (x *NanoPBOptions) ClearTypeOverride()
func (*NanoPBOptions) GetAnonymousOneof ¶
func (x *NanoPBOptions) GetAnonymousOneof() bool
func (*NanoPBOptions) GetCallbackDatatype ¶
func (x *NanoPBOptions) GetCallbackDatatype() string
func (*NanoPBOptions) GetCallbackFunction ¶
func (x *NanoPBOptions) GetCallbackFunction() string
func (*NanoPBOptions) GetDefaultHas ¶
func (x *NanoPBOptions) GetDefaultHas() bool
func (*NanoPBOptions) GetDescriptorsize ¶
func (x *NanoPBOptions) GetDescriptorsize() DescriptorSize
func (*NanoPBOptions) GetEnumToString ¶
func (x *NanoPBOptions) GetEnumToString() bool
func (*NanoPBOptions) GetExclude ¶
func (x *NanoPBOptions) GetExclude() []string
func (*NanoPBOptions) GetFallbackType ¶
func (x *NanoPBOptions) GetFallbackType() FieldType
func (*NanoPBOptions) GetFixedCount ¶
func (x *NanoPBOptions) GetFixedCount() bool
func (*NanoPBOptions) GetFixedLength ¶
func (x *NanoPBOptions) GetFixedLength() bool
func (*NanoPBOptions) GetInclude ¶
func (x *NanoPBOptions) GetInclude() []string
func (*NanoPBOptions) GetIntSize ¶
func (x *NanoPBOptions) GetIntSize() IntSize
func (*NanoPBOptions) GetLongNames ¶
func (x *NanoPBOptions) GetLongNames() bool
func (*NanoPBOptions) GetMangleNames ¶
func (x *NanoPBOptions) GetMangleNames() TypenameMangling
func (*NanoPBOptions) GetMaxCount ¶
func (x *NanoPBOptions) GetMaxCount() int32
func (*NanoPBOptions) GetMaxLength ¶
func (x *NanoPBOptions) GetMaxLength() int32
func (*NanoPBOptions) GetMaxSize ¶
func (x *NanoPBOptions) GetMaxSize() int32
func (*NanoPBOptions) GetMsgid ¶
func (x *NanoPBOptions) GetMsgid() uint32
func (*NanoPBOptions) GetNoUnions ¶
func (x *NanoPBOptions) GetNoUnions() bool
func (*NanoPBOptions) GetPackage ¶
func (x *NanoPBOptions) GetPackage() string
func (*NanoPBOptions) GetPackedEnum ¶
func (x *NanoPBOptions) GetPackedEnum() bool
func (*NanoPBOptions) GetPackedStruct ¶
func (x *NanoPBOptions) GetPackedStruct() bool
func (*NanoPBOptions) GetProto3 ¶
func (x *NanoPBOptions) GetProto3() bool
func (*NanoPBOptions) GetProto3SingularMsgs ¶
func (x *NanoPBOptions) GetProto3SingularMsgs() bool
func (*NanoPBOptions) GetSkipMessage ¶
func (x *NanoPBOptions) GetSkipMessage() bool
func (*NanoPBOptions) GetSortByTag ¶
func (x *NanoPBOptions) GetSortByTag() bool
func (*NanoPBOptions) GetSubmsgCallback ¶
func (x *NanoPBOptions) GetSubmsgCallback() bool
func (*NanoPBOptions) GetType ¶
func (x *NanoPBOptions) GetType() FieldType
func (*NanoPBOptions) GetTypeOverride ¶
func (x *NanoPBOptions) GetTypeOverride() descriptorpb.FieldDescriptorProto_Type
func (*NanoPBOptions) HasAnonymousOneof ¶
func (x *NanoPBOptions) HasAnonymousOneof() bool
func (*NanoPBOptions) HasCallbackDatatype ¶
func (x *NanoPBOptions) HasCallbackDatatype() bool
func (*NanoPBOptions) HasCallbackFunction ¶
func (x *NanoPBOptions) HasCallbackFunction() bool
func (*NanoPBOptions) HasDefaultHas ¶
func (x *NanoPBOptions) HasDefaultHas() bool
func (*NanoPBOptions) HasDescriptorsize ¶
func (x *NanoPBOptions) HasDescriptorsize() bool
func (*NanoPBOptions) HasEnumToString ¶
func (x *NanoPBOptions) HasEnumToString() bool
func (*NanoPBOptions) HasFallbackType ¶
func (x *NanoPBOptions) HasFallbackType() bool
func (*NanoPBOptions) HasFixedCount ¶
func (x *NanoPBOptions) HasFixedCount() bool
func (*NanoPBOptions) HasFixedLength ¶
func (x *NanoPBOptions) HasFixedLength() bool
func (*NanoPBOptions) HasIntSize ¶
func (x *NanoPBOptions) HasIntSize() bool
func (*NanoPBOptions) HasLongNames ¶
func (x *NanoPBOptions) HasLongNames() bool
func (*NanoPBOptions) HasMangleNames ¶
func (x *NanoPBOptions) HasMangleNames() bool
func (*NanoPBOptions) HasMaxCount ¶
func (x *NanoPBOptions) HasMaxCount() bool
func (*NanoPBOptions) HasMaxLength ¶
func (x *NanoPBOptions) HasMaxLength() bool
func (*NanoPBOptions) HasMaxSize ¶
func (x *NanoPBOptions) HasMaxSize() bool
func (*NanoPBOptions) HasMsgid ¶
func (x *NanoPBOptions) HasMsgid() bool
func (*NanoPBOptions) HasNoUnions ¶
func (x *NanoPBOptions) HasNoUnions() bool
func (*NanoPBOptions) HasPackage ¶
func (x *NanoPBOptions) HasPackage() bool
func (*NanoPBOptions) HasPackedEnum ¶
func (x *NanoPBOptions) HasPackedEnum() bool
func (*NanoPBOptions) HasPackedStruct ¶
func (x *NanoPBOptions) HasPackedStruct() bool
func (*NanoPBOptions) HasProto3 ¶
func (x *NanoPBOptions) HasProto3() bool
func (*NanoPBOptions) HasProto3SingularMsgs ¶
func (x *NanoPBOptions) HasProto3SingularMsgs() bool
func (*NanoPBOptions) HasSkipMessage ¶
func (x *NanoPBOptions) HasSkipMessage() bool
func (*NanoPBOptions) HasSortByTag ¶
func (x *NanoPBOptions) HasSortByTag() bool
func (*NanoPBOptions) HasSubmsgCallback ¶
func (x *NanoPBOptions) HasSubmsgCallback() bool
func (*NanoPBOptions) HasType ¶
func (x *NanoPBOptions) HasType() bool
func (*NanoPBOptions) HasTypeOverride ¶
func (x *NanoPBOptions) HasTypeOverride() bool
func (*NanoPBOptions) ProtoMessage ¶
func (*NanoPBOptions) ProtoMessage()
func (*NanoPBOptions) ProtoReflect ¶
func (x *NanoPBOptions) ProtoReflect() protoreflect.Message
func (*NanoPBOptions) Reset ¶
func (x *NanoPBOptions) Reset()
func (*NanoPBOptions) SetAnonymousOneof ¶
func (x *NanoPBOptions) SetAnonymousOneof(v bool)
func (*NanoPBOptions) SetCallbackDatatype ¶
func (x *NanoPBOptions) SetCallbackDatatype(v string)
func (*NanoPBOptions) SetCallbackFunction ¶
func (x *NanoPBOptions) SetCallbackFunction(v string)
func (*NanoPBOptions) SetDefaultHas ¶
func (x *NanoPBOptions) SetDefaultHas(v bool)
func (*NanoPBOptions) SetDescriptorsize ¶
func (x *NanoPBOptions) SetDescriptorsize(v DescriptorSize)
func (*NanoPBOptions) SetEnumToString ¶
func (x *NanoPBOptions) SetEnumToString(v bool)
func (*NanoPBOptions) SetExclude ¶
func (x *NanoPBOptions) SetExclude(v []string)
func (*NanoPBOptions) SetFallbackType ¶
func (x *NanoPBOptions) SetFallbackType(v FieldType)
func (*NanoPBOptions) SetFixedCount ¶
func (x *NanoPBOptions) SetFixedCount(v bool)
func (*NanoPBOptions) SetFixedLength ¶
func (x *NanoPBOptions) SetFixedLength(v bool)
func (*NanoPBOptions) SetInclude ¶
func (x *NanoPBOptions) SetInclude(v []string)
func (*NanoPBOptions) SetIntSize ¶
func (x *NanoPBOptions) SetIntSize(v IntSize)
func (*NanoPBOptions) SetLongNames ¶
func (x *NanoPBOptions) SetLongNames(v bool)
func (*NanoPBOptions) SetMangleNames ¶
func (x *NanoPBOptions) SetMangleNames(v TypenameMangling)
func (*NanoPBOptions) SetMaxCount ¶
func (x *NanoPBOptions) SetMaxCount(v int32)
func (*NanoPBOptions) SetMaxLength ¶
func (x *NanoPBOptions) SetMaxLength(v int32)
func (*NanoPBOptions) SetMaxSize ¶
func (x *NanoPBOptions) SetMaxSize(v int32)
func (*NanoPBOptions) SetMsgid ¶
func (x *NanoPBOptions) SetMsgid(v uint32)
func (*NanoPBOptions) SetNoUnions ¶
func (x *NanoPBOptions) SetNoUnions(v bool)
func (*NanoPBOptions) SetPackage ¶
func (x *NanoPBOptions) SetPackage(v string)
func (*NanoPBOptions) SetPackedEnum ¶
func (x *NanoPBOptions) SetPackedEnum(v bool)
func (*NanoPBOptions) SetPackedStruct ¶
func (x *NanoPBOptions) SetPackedStruct(v bool)
func (*NanoPBOptions) SetProto3 ¶
func (x *NanoPBOptions) SetProto3(v bool)
func (*NanoPBOptions) SetProto3SingularMsgs ¶
func (x *NanoPBOptions) SetProto3SingularMsgs(v bool)
func (*NanoPBOptions) SetSkipMessage ¶
func (x *NanoPBOptions) SetSkipMessage(v bool)
func (*NanoPBOptions) SetSortByTag ¶
func (x *NanoPBOptions) SetSortByTag(v bool)
func (*NanoPBOptions) SetSubmsgCallback ¶
func (x *NanoPBOptions) SetSubmsgCallback(v bool)
func (*NanoPBOptions) SetType ¶
func (x *NanoPBOptions) SetType(v FieldType)
func (*NanoPBOptions) SetTypeOverride ¶
func (x *NanoPBOptions) SetTypeOverride(v descriptorpb.FieldDescriptorProto_Type)
func (*NanoPBOptions) String ¶
func (x *NanoPBOptions) String() string
type NanoPBOptions_builder ¶
type NanoPBOptions_builder struct {
// Allocated size for 'bytes' and 'string' fields.
// For string fields, this should include the space for null terminator.
MaxSize *int32
// Maximum length for 'string' fields. Setting this is equivalent
// to setting max_size to a value of length+1.
MaxLength *int32
// Allocated number of entries in arrays ('repeated' fields)
MaxCount *int32
// Size of integer fields. Can save some memory if you don't need
// full 32 bits for the value.
IntSize *IntSize
// Force type of field (callback or static allocation)
Type *FieldType
// Use long names for enums, i.e. EnumName_EnumValue.
LongNames *bool
// Add 'packed' attribute to generated structs.
// Note: this cannot be used on CPUs that break on unaligned
// accesses to variables.
PackedStruct *bool
// Add 'packed' attribute to generated enums.
PackedEnum *bool
// Skip this message
SkipMessage *bool
// Generate oneof fields as normal optional fields instead of union.
NoUnions *bool
// integer type tag for a message
Msgid *uint32
// decode oneof as anonymous union
AnonymousOneof *bool
// Proto3 singular field does not generate a "has_" flag
Proto3 *bool
// Force proto3 messages to have no "has_" flag.
// This was default behavior until nanopb-0.4.0.
Proto3SingularMsgs *bool
// Generate an enum->string mapping function (can take up lots of space).
EnumToString *bool
// Generate bytes arrays with fixed length
FixedLength *bool
// Generate repeated field with fixed count
FixedCount *bool
// Generate message-level callback that is called before decoding submessages.
// This can be used to set callback fields for submsgs inside oneofs.
SubmsgCallback *bool
// Shorten or remove package names from type names.
// This option applies only on the file level.
MangleNames *TypenameMangling
// Data type for storage associated with callback fields.
CallbackDatatype *string
// Callback function used for encoding and decoding.
// Prior to nanopb-0.4.0, the callback was specified in per-field pb_callback_t
// structure. This is still supported, but does not work inside e.g. oneof or pointer
// fields. Instead, a new method allows specifying a per-message callback that
// will be called for all callback fields in a message type.
CallbackFunction *string
// Select the size of field descriptors. This option has to be defined
// for the whole message, not per-field. Usually automatic selection is
// ok, but if it results in compilation errors you can increase the field
// size here.
Descriptorsize *DescriptorSize
// Set default value for has_ fields.
DefaultHas *bool
// Extra files to include in generated `.pb.h`
Include []string
// Automatic includes to exclude from generated `.pb.h`
// Same as nanopb_generator.py command line flag -x.
Exclude []string
// Package name that applies only for nanopb.
Package *string
// Override type of the field in generated C code. Only to be used with related field types
TypeOverride *descriptorpb.FieldDescriptorProto_Type
// Due to historical reasons, nanopb orders fields in structs by their tag number
// instead of the order in .proto. Set this to false to keep the .proto order.
// The default value will probably change to false in nanopb-0.5.0.
SortByTag *bool
// Set the FT_DEFAULT field conversion strategy.
// A field that can become a static member of a c struct (e.g. int, bool, etc)
// will be a a static field.
// Fields with dynamic length are converted to either a pointer or a callback.
FallbackType *FieldType
// contains filtered or unexported fields
}
func (NanoPBOptions_builder) Build ¶
func (b0 NanoPBOptions_builder) Build() *NanoPBOptions
type TypenameMangling ¶
type TypenameMangling int32
const ( TypenameMangling_M_NONE TypenameMangling = 0 // Default, no typename mangling TypenameMangling_M_STRIP_PACKAGE TypenameMangling = 1 // Strip current package name TypenameMangling_M_FLATTEN TypenameMangling = 2 // Only use last path component TypenameMangling_M_PACKAGE_INITIALS TypenameMangling = 3 // Replace the package name by the initials )
func (TypenameMangling) Descriptor ¶
func (TypenameMangling) Descriptor() protoreflect.EnumDescriptor
func (TypenameMangling) Enum ¶
func (x TypenameMangling) Enum() *TypenameMangling
func (TypenameMangling) Number ¶
func (x TypenameMangling) Number() protoreflect.EnumNumber
func (TypenameMangling) String ¶
func (x TypenameMangling) String() string
func (TypenameMangling) Type ¶
func (TypenameMangling) Type() protoreflect.EnumType
Source Files
¶
- nanopb.pb.go
Click to show internal directories.
Click to hide internal directories.