...

Package pbinternal

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

Overview ▾

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.

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
)