defaults

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Disabled nullifies any defaults for this message, including any
	// message fields associated with it that do support defaults.
	//
	// optional bool disabled = 1171;
	E_Disabled = &file_defaults_defaults_proto_extTypes[0]
	// Ignore skips generation of default methods for this message.
	//
	// optional bool ignored = 1172;
	E_Ignored = &file_defaults_defaults_proto_extTypes[1]
	// Unexported generate an unexported defaults method, this can
	// be useful when we want both the generated defaults and a custom
	// defaults method that will call the unexported method.
	//
	// optional bool unexported = 1173;
	E_Unexported = &file_defaults_defaults_proto_extTypes[2]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// optional string oneof = 1171;
	E_Oneof = &file_defaults_defaults_proto_extTypes[3]
)

Extension fields to descriptorpb.OneofOptions.

View Source
var (
	// Value specify the default value to set on this field. By default,
	// none is set on a field.
	//
	// optional defaults.FieldDefaults value = 1171;
	E_Value = &file_defaults_defaults_proto_extTypes[4]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var File_defaults_defaults_proto protoreflect.FileDescriptor

Functions

func Apply

func Apply(m proto.Message)

Types

type FieldDefaults

type FieldDefaults struct {

	// Types that are assignable to Type:
	//	*FieldDefaults_Float
	//	*FieldDefaults_Double
	//	*FieldDefaults_Int32
	//	*FieldDefaults_Int64
	//	*FieldDefaults_Uint32
	//	*FieldDefaults_Uint64
	//	*FieldDefaults_Sint32
	//	*FieldDefaults_Sint64
	//	*FieldDefaults_Fixed32
	//	*FieldDefaults_Fixed64
	//	*FieldDefaults_Sfixed32
	//	*FieldDefaults_Sfixed64
	//	*FieldDefaults_Bool
	//	*FieldDefaults_String_
	//	*FieldDefaults_Bytes
	//	*FieldDefaults_Enum
	//	*FieldDefaults_Message
	//	*FieldDefaults_Duration
	//	*FieldDefaults_Timestamp
	Type isFieldDefaults_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

FieldDefaults encapsulates the default values for each type of field. Depending on the field, the correct set should be used to ensure proper defaults generation.

func (*FieldDefaults) Descriptor deprecated

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

Deprecated: Use FieldDefaults.ProtoReflect.Descriptor instead.

func (*FieldDefaults) GetBool

func (x *FieldDefaults) GetBool() bool

func (*FieldDefaults) GetBytes

func (x *FieldDefaults) GetBytes() []byte

func (*FieldDefaults) GetDouble

func (x *FieldDefaults) GetDouble() float64

func (*FieldDefaults) GetDuration

func (x *FieldDefaults) GetDuration() string

func (*FieldDefaults) GetEnum

func (x *FieldDefaults) GetEnum() uint32

func (*FieldDefaults) GetFixed32

func (x *FieldDefaults) GetFixed32() uint32

func (*FieldDefaults) GetFixed64

func (x *FieldDefaults) GetFixed64() uint64

func (*FieldDefaults) GetFloat

func (x *FieldDefaults) GetFloat() float32

func (*FieldDefaults) GetInt32

func (x *FieldDefaults) GetInt32() int32

func (*FieldDefaults) GetInt64

func (x *FieldDefaults) GetInt64() int64

func (*FieldDefaults) GetMessage

func (x *FieldDefaults) GetMessage() *MessageDefaults

func (*FieldDefaults) GetSfixed32

func (x *FieldDefaults) GetSfixed32() int32

func (*FieldDefaults) GetSfixed64

func (x *FieldDefaults) GetSfixed64() int64

func (*FieldDefaults) GetSint32

func (x *FieldDefaults) GetSint32() int32

func (*FieldDefaults) GetSint64

func (x *FieldDefaults) GetSint64() int64

func (*FieldDefaults) GetString_

func (x *FieldDefaults) GetString_() string

func (*FieldDefaults) GetTimestamp

func (x *FieldDefaults) GetTimestamp() string

func (*FieldDefaults) GetType

func (m *FieldDefaults) GetType() isFieldDefaults_Type

func (*FieldDefaults) GetUint32

func (x *FieldDefaults) GetUint32() uint32

func (*FieldDefaults) GetUint64

func (x *FieldDefaults) GetUint64() uint64

func (*FieldDefaults) ProtoMessage

func (*FieldDefaults) ProtoMessage()

func (*FieldDefaults) ProtoReflect

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

func (*FieldDefaults) Reset

func (x *FieldDefaults) Reset()

func (*FieldDefaults) String

func (x *FieldDefaults) String() string

type FieldDefaults_Bool

type FieldDefaults_Bool struct {
	Bool bool `protobuf:"varint,13,opt,name=bool,oneof"`
}

type FieldDefaults_Bytes

type FieldDefaults_Bytes struct {
	Bytes []byte `protobuf:"bytes,15,opt,name=bytes,oneof"`
}

type FieldDefaults_Double

type FieldDefaults_Double struct {
	Double float64 `protobuf:"fixed64,2,opt,name=double,oneof"`
}

type FieldDefaults_Duration

type FieldDefaults_Duration struct {
	// Well-Known Field Types
	// any       = 20;
	Duration string `protobuf:"bytes,21,opt,name=duration,oneof"`
}

type FieldDefaults_Enum

type FieldDefaults_Enum struct {
	// Complex Field Types
	Enum uint32 `protobuf:"varint,16,opt,name=enum,oneof"`
}

type FieldDefaults_Fixed32

type FieldDefaults_Fixed32 struct {
	Fixed32 uint32 `protobuf:"fixed32,9,opt,name=fixed32,oneof"`
}

type FieldDefaults_Fixed64

type FieldDefaults_Fixed64 struct {
	Fixed64 uint64 `protobuf:"fixed64,10,opt,name=fixed64,oneof"`
}

type FieldDefaults_Float

type FieldDefaults_Float struct {
	// Scalar Field Types
	Float float32 `protobuf:"fixed32,1,opt,name=float,oneof"`
}

type FieldDefaults_Int32

type FieldDefaults_Int32 struct {
	Int32 int32 `protobuf:"varint,3,opt,name=int32,oneof"`
}

type FieldDefaults_Int64

type FieldDefaults_Int64 struct {
	Int64 int64 `protobuf:"varint,4,opt,name=int64,oneof"`
}

type FieldDefaults_Message

type FieldDefaults_Message struct {
	Message *MessageDefaults `protobuf:"bytes,17,opt,name=message,oneof"`
}

type FieldDefaults_Sfixed32

type FieldDefaults_Sfixed32 struct {
	Sfixed32 int32 `protobuf:"fixed32,11,opt,name=sfixed32,oneof"`
}

type FieldDefaults_Sfixed64

type FieldDefaults_Sfixed64 struct {
	Sfixed64 int64 `protobuf:"fixed64,12,opt,name=sfixed64,oneof"`
}

type FieldDefaults_Sint32

type FieldDefaults_Sint32 struct {
	Sint32 int32 `protobuf:"zigzag32,7,opt,name=sint32,oneof"`
}

type FieldDefaults_Sint64

type FieldDefaults_Sint64 struct {
	Sint64 int64 `protobuf:"zigzag64,8,opt,name=sint64,oneof"`
}

type FieldDefaults_String_

type FieldDefaults_String_ struct {
	String_ string `protobuf:"bytes,14,opt,name=string,oneof"`
}

type FieldDefaults_Timestamp

type FieldDefaults_Timestamp struct {
	Timestamp string `protobuf:"bytes,22,opt,name=timestamp,oneof"`
}

type FieldDefaults_Uint32

type FieldDefaults_Uint32 struct {
	Uint32 uint32 `protobuf:"varint,5,opt,name=uint32,oneof"`
}

type FieldDefaults_Uint64

type FieldDefaults_Uint64 struct {
	Uint64 uint64 `protobuf:"varint,6,opt,name=uint64,oneof"`
}

type MessageDefaults

type MessageDefaults struct {

	// Initialize specify that the message should be initialized
	Initialize *bool `protobuf:"varint,1,opt,name=initialize" json:"initialize,omitempty"`
	// Defaults specifies that the messages' defaults should be applied
	Defaults *bool `protobuf:"varint,2,opt,name=defaults" json:"defaults,omitempty"`
	// contains filtered or unexported fields
}

MessageDefaults define the default behaviour for this field.

func (*MessageDefaults) Descriptor deprecated

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

Deprecated: Use MessageDefaults.ProtoReflect.Descriptor instead.

func (*MessageDefaults) GetDefaults

func (x *MessageDefaults) GetDefaults() bool

func (*MessageDefaults) GetInitialize

func (x *MessageDefaults) GetInitialize() bool

func (*MessageDefaults) ProtoMessage

func (*MessageDefaults) ProtoMessage()

func (*MessageDefaults) ProtoReflect

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

func (*MessageDefaults) Reset

func (x *MessageDefaults) Reset()

func (*MessageDefaults) String

func (x *MessageDefaults) String() string

Jump to

Keyboard shortcuts

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