_go

package module
v1.34.0-20240430122307... Latest Latest
Warning

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

Go to latest
Published: unknown License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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) Enum

func (x DescriptorSize) Enum() *DescriptorSize

func (DescriptorSize) EnumDescriptor deprecated

func (DescriptorSize) EnumDescriptor() ([]byte, []int)

Deprecated: Use DescriptorSize.Descriptor instead.

func (DescriptorSize) Number

func (DescriptorSize) String

func (x DescriptorSize) String() string

func (DescriptorSize) Type

func (*DescriptorSize) UnmarshalJSON deprecated

func (x *DescriptorSize) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

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) Enum

func (x FieldType) Enum() *FieldType

func (FieldType) EnumDescriptor deprecated

func (FieldType) EnumDescriptor() ([]byte, []int)

Deprecated: Use FieldType.Descriptor instead.

func (FieldType) Number

func (x FieldType) Number() protoreflect.EnumNumber

func (FieldType) String

func (x FieldType) String() string

func (FieldType) Type

func (*FieldType) UnmarshalJSON deprecated

func (x *FieldType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type IntSize

type IntSize int32
const (
	IntSize_IS_DEFAULT IntSize = 0 // Default, 32/64bit based on type in .proto
	IntSize_IS_8       IntSize = 8
	IntSize_IS_16      IntSize = 16
	IntSize_IS_32      IntSize = 32
	IntSize_IS_64      IntSize = 64
)

func (IntSize) Descriptor

func (IntSize) Descriptor() protoreflect.EnumDescriptor

func (IntSize) Enum

func (x IntSize) Enum() *IntSize

func (IntSize) EnumDescriptor deprecated

func (IntSize) EnumDescriptor() ([]byte, []int)

Deprecated: Use IntSize.Descriptor instead.

func (IntSize) Number

func (x IntSize) Number() protoreflect.EnumNumber

func (IntSize) String

func (x IntSize) String() string

func (IntSize) Type

func (IntSize) Type() protoreflect.EnumType

func (*IntSize) UnmarshalJSON deprecated

func (x *IntSize) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

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) Descriptor deprecated

func (*NanoPBOptions) Descriptor() ([]byte, []int)

Deprecated: Use NanoPBOptions.ProtoReflect.Descriptor instead.

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 (*NanoPBOptions) ProtoMessage

func (*NanoPBOptions) ProtoMessage()

func (*NanoPBOptions) ProtoReflect

func (x *NanoPBOptions) ProtoReflect() protoreflect.Message

func (*NanoPBOptions) Reset

func (x *NanoPBOptions) Reset()

func (*NanoPBOptions) String

func (x *NanoPBOptions) String() string

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) Enum

func (TypenameMangling) EnumDescriptor deprecated

func (TypenameMangling) EnumDescriptor() ([]byte, []int)

Deprecated: Use TypenameMangling.Descriptor instead.

func (TypenameMangling) Number

func (TypenameMangling) String

func (x TypenameMangling) String() string

func (TypenameMangling) Type

func (*TypenameMangling) UnmarshalJSON deprecated

func (x *TypenameMangling) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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