pbinternal

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchByInt

func MatchByInt(v cue.Value, val int64) string

MatchByInt finds a symbol for a given enum value and sets it in x.

func MatchBySymbol

func MatchBySymbol(v cue.Value, name string, x *ast.BasicLit) bool

MatchBySymbol finds an integer value for a given symbol name, representing an enum value, and sets it in x.

Types

type CompositeType

type CompositeType int
const (
	Normal CompositeType = iota
	List
	Map
)

type Info

type Info struct {
	Name    string
	CUEName string
	Attr    cue.Attribute
	Value   cue.Value

	CompositeType CompositeType
	ValueType     ValueType
	Type          string

	IsEnum bool

	// For maps only
	KeyType       ValueType // only for maps
	KeyTypeString string
}

func FromIter

func FromIter(i *cue.Iterator) (info Info, err error)

func FromValue

func FromValue(name string, v cue.Value) (info Info, err error)

type ValueType

type ValueType int
const (
	Unknown ValueType = iota
	Message
	Int
	Float
	String
	Bytes
	Bool
)

Jump to

Keyboard shortcuts

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