descriptors

package
v0.0.0-...-0f4f15d Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(descriptor protoreflect.Descriptor) string

func ToInterfaceMap

func ToInterfaceMap(v interface{}) (map[string]interface{}, error)

Types

type DataMap

type DataMap map[string]*DataValue

func (DataMap) ToInterfaceMap

func (d DataMap) ToInterfaceMap() map[string]interface{}

func (DataMap) ToJSON

func (d DataMap) ToJSON() ([]byte, error)

type DataValue

type DataValue struct {
	Kind  protoreflect.Kind `json:"-"`
	Proto bool              `json:"-"`
	Value interface{}       `json:"value"`
	Empty bool              `json:"-"`
}

func (*DataValue) Set

func (v *DataValue) Set(val string) error

func (*DataValue) String

func (v *DataValue) String() string

func (*DataValue) Type

func (v *DataValue) Type() string

type List

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

func (*List) Append

func (l *List) Append(v protoreflect.Value)

Append appends the provided value to the end of the list. When appending a composite type, it is unspecified whether the appended value aliases the source's memory in any way.

Append is a mutating operation and unsafe for concurrent use.

func (*List) AppendMutable

func (l *List) AppendMutable() protoreflect.Value

AppendMutable appends a new, empty, mutable message value to the end of the list and returns it. It panics if the list does not contain a message type.

func (*List) Get

func (l *List) Get(i int) protoreflect.Value

Get retrieves the value at the given index. It never returns an invalid value.

func (*List) IsValid

func (l *List) IsValid() bool

IsValid reports whether the list is valid.

An invalid list is an empty, read-only value.

Validity is not part of the protobuf data model, and may not be preserved in marshaling or other operations.

func (*List) Len

func (l *List) Len() int

Len reports the number of entries in the List. Get, Set, and Truncate panic with out of bound indexes.

func (*List) NewElement

func (l *List) NewElement() protoreflect.Value

NewElement returns a new value for a list element. For enums, this returns the first enum value. For other scalars, this returns the zero value. For messages, this returns a new, empty, mutable value.

func (*List) Set

func (l *List) Set(i int, val protoreflect.Value)

Set stores a value for the given index. When setting a composite type, it is unspecified whether the set value aliases the source's memory in any way.

Set is a mutating operation and unsafe for concurrent use.

func (*List) Truncate

func (l *List) Truncate(i int)

Truncate truncates the list to a smaller length.

Truncate is a mutating operation and unsafe for concurrent use.

Jump to

Keyboard shortcuts

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