package pkg
import "cuelang.org/go/internal/pkg"
Index ¶
- func Register(importPath string, p *Package)
- func ToBuiltin(b *Builtin) *adt.Builtin
- type Bottomer
- type Builtin
- type CallCtxt
- func (c *CallCtxt) BigFloat(i int) *big.Float
- func (c *CallCtxt) BigInt(i int) *big.Int
- func (c *CallCtxt) Bool(i int) bool
- func (c *CallCtxt) Byte(i int) uint8
- func (c *CallCtxt) Bytes(i int) []byte
- func (c *CallCtxt) CueList(i int) List
- func (c *CallCtxt) Decimal(i int) *apd.Decimal
- func (c *CallCtxt) DecimalList(i int) (a []*apd.Decimal)
- func (c *CallCtxt) Do() bool
- func (c *CallCtxt) Float64(i int) float64
- func (c *CallCtxt) Int(i int) int
- func (c *CallCtxt) Int16(i int) int16
- func (c *CallCtxt) Int32(i int) int32
- func (c *CallCtxt) Int64(i int) int64
- func (c *CallCtxt) Int8(i int) int8
- func (c *CallCtxt) Iter(i int) (a cue.Iterator)
- func (c *CallCtxt) List(i int) (a []cue.Value)
- func (c *CallCtxt) Name() string
- func (c *CallCtxt) Pos() token.Pos
- func (c *CallCtxt) Reader(i int) io.Reader
- func (c *CallCtxt) Rune(i int) rune
- func (c *CallCtxt) Schema(i int) Schema
- func (c *CallCtxt) String(i int) string
- func (c *CallCtxt) StringList(i int) (a []string)
- func (c *CallCtxt) Struct(i int) Struct
- func (c *CallCtxt) Uint(i int) uint
- func (c *CallCtxt) Uint16(i int) uint16
- func (c *CallCtxt) Uint32(i int) uint32
- func (c *CallCtxt) Uint64(i int) uint64
- func (c *CallCtxt) Uint8(i int) uint8
- func (c *CallCtxt) Value(i int) cue.Value
- type List
- type Package
- type Param
- type Schema
- type Struct
- func (s *Struct) Arcs() []*adt.Vertex
- func (s *Struct) IsOpen() bool
- func (s *Struct) Len() int
- func (s Struct) NumConstraintFields() (count int)
- type ValidationError
Functions ¶
func Register ¶
func ToBuiltin ¶
ToBuiltin converts a Builtin into an adt.Builtin.
Types ¶
type Bottomer ¶
type Builtin ¶
type Builtin struct { Name string Pkg adt.Feature Params []Param Result adt.Kind NonConcrete bool Func func(c *CallCtxt) Const string }
A Builtin is a Builtin function or constant.
A function may return and a constant may be any of the following types:
error (translates to bottom) nil (translates to null) bool int* uint* float64 string *big.Float *big.Int For any of the above, including interface{} and these types recursively: []T map[string]T
type CallCtxt ¶
type CallCtxt struct { Err interface{} Ret interface{} // contains filtered or unexported fields }
CallCtxt is passed to builtin implementations that need to use a cue.Value. This is an internal type. Its interface may change.
func (*CallCtxt) BigFloat ¶
func (*CallCtxt) BigInt ¶
func (*CallCtxt) Bool ¶
func (*CallCtxt) Byte ¶
func (*CallCtxt) Bytes ¶
func (*CallCtxt) CueList ¶
func (*CallCtxt) Decimal ¶
func (*CallCtxt) DecimalList ¶
func (*CallCtxt) Do ¶
Do returns whether the call should be done.
func (*CallCtxt) Float64 ¶
func (*CallCtxt) Int ¶
func (*CallCtxt) Int16 ¶
func (*CallCtxt) Int32 ¶
func (*CallCtxt) Int64 ¶
func (*CallCtxt) Int8 ¶
func (*CallCtxt) Iter ¶
func (*CallCtxt) List ¶
func (*CallCtxt) Name ¶
func (*CallCtxt) Pos ¶
func (*CallCtxt) Reader ¶
func (*CallCtxt) Rune ¶
func (*CallCtxt) Schema ¶
Schema returns the ith argument as is, without converting it to a cue.Value.
func (*CallCtxt) String ¶
func (*CallCtxt) StringList ¶
func (*CallCtxt) Struct ¶
func (*CallCtxt) Uint ¶
func (*CallCtxt) Uint16 ¶
func (*CallCtxt) Uint32 ¶
func (*CallCtxt) Uint64 ¶
func (*CallCtxt) Uint8 ¶
func (*CallCtxt) Value ¶
Value returns a finalized cue.Value for the ith argument.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents a CUE list, which can be open or closed.
func (*List) Elems ¶
Elems returns the elements of a list.
func (*List) IsOpen ¶
IsOpen reports whether a list is open ended.
type Package ¶
func (*Package) MustCompile ¶
type Param ¶
type Schema ¶
A Schema represents an arbitrary cue.Value that can hold non-concrete values. By default function arguments are checked to be concrete.
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
Struct represents a CUE struct, which can be open or closed.
func (*Struct) Arcs ¶
Arcs returns all arcs of s.
func (*Struct) IsOpen ¶
IsOpen reports whether s is open or has pattern constraints.
func (*Struct) Len ¶
Len reports the number of regular string fields of s.
func (Struct) NumConstraintFields ¶
NumConstraintFields reports the number of explicit optional and required fields, excluding pattern constraints.
type ValidationError ¶
A ValidationError indicates an error that is only valid if a builtin is used as a validator.
func (ValidationError) Error ¶
func (v ValidationError) Error() string
Source Files ¶
builtin.go context.go errors.go register.go types.go
- Version
- v0.12.0 (latest)
- Published
- Jan 30, 2025
- Platform
- linux/amd64
- Imports
- 16 packages
- Last checked
- 8 hours ago –
Tools for package owners.