enum

package
v0.0.0-...-d4cb099 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Descriptor

type Descriptor struct {
	Values ValueDescriptors
	// contains filtered or unexported fields
}

Descriptor describes an enum type.

func NewDescriptor

func NewDescriptor(name string) *Descriptor

NewDescriptor returns the new named *Descriptor.

func (*Descriptor) Descriptor

func (d *Descriptor) Descriptor() *descriptorpb.EnumDescriptorProto

Descriptor returns the enum descriptor.

func (*Descriptor) GetComment

func (d *Descriptor) GetComment() *protodesc.Comment

GetComment gets the enum comment.

func (*Descriptor) GetName

func (d *Descriptor) GetName() string

GetName gets the enum name.

func (*Descriptor) GetOptions

func (d *Descriptor) GetOptions() *descriptorpb.EnumOptions

GetOptions gets the enum options.

func (*Descriptor) GetReservedName

func (d *Descriptor) GetReservedName() []string

GetReservedName gets the enum reserved names.

func (*Descriptor) GetReservedRange

GetReservedRange gets the enum reserved range.

func (*Descriptor) GetValue

func (d *Descriptor) GetValue() ValueDescriptors

GetValue gets the enum values.

func (*Descriptor) SetDetachedComment

func (d *Descriptor) SetDetachedComment(detached []string)

SetDetachedComment sets the enum detached comments.

func (*Descriptor) SetLeadingComment

func (d *Descriptor) SetLeadingComment(fn, leading string)

SetLeadingComment sets the enum leading comment.

func (*Descriptor) SetTrailingComment

func (d *Descriptor) SetTrailingComment(trailing string)

SetTrailingComment sets the enum trailing comment.

type ValueDescriptor

type ValueDescriptor struct {
	// contains filtered or unexported fields
}

ValueDescriptor describes a value within an enum.

func NewValueDescriptor

func NewValueDescriptor(name string, number int32) *ValueDescriptor

NewValueDescriptor returns the new named *ValueDescriptor with number.

func (*ValueDescriptor) Descriptor

Descriptor returns the enum value descriptor.

func (*ValueDescriptor) GetName

func (d *ValueDescriptor) GetName() string

GetName gets the enum name.

func (*ValueDescriptor) SetDeprecated

func (d *ValueDescriptor) SetDeprecated()

SetDeprecated sets the deprecated itself.

type ValueDescriptors

type ValueDescriptors []*ValueDescriptor

ValueDescriptors describes a slice of value within an enum.

func (ValueDescriptors) Descriptor

Descriptor returns the enum value descriptors.

Jump to

Keyboard shortcuts

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