package pbinternal

import "cuelang.org/go/encoding/protobuf/pbinternal"

Index

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
)

Source Files

attribute.go symbol.go

Version
v0.12.0 (latest)
Published
Jan 30, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
8 hours ago

Tools for package owners.