Documentation ¶
Index ¶
- func BuildImport(path string, templates map[string]string) (*build.Instance, error)
- func FieldValues(value cue.Value) []cue.Value
- func Iterate(value cue.Value, fn func(v cue.Value) (stop bool)) (stop bool)
- func Print(value cue.Value, options ...PrintOption) ([]byte, error)
- func ToRawString(v cue.Value, opts ...cue.Option) (string, error)
- func ToString(v cue.Value, opts ...cue.Option) (string, error)
- type PrintConfig
- type PrintFormat
- type PrintOption
- type WithFormat
- type WithPath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildImport ¶
BuildImport create build.Instance with given cue templates. `path` is the cue import path for the build.Instance, like `import "example/demo"`
func FieldValues ¶ added in v1.9.0
FieldValues the field values of the given value If the given value is a list, all its items will be returned If the given value is a map, all its key-value entries will be returned The returned values will be sorted in the order of their "step" attribute
func Iterate ¶
Iterate over all fields of the cue.Value with fn, if fn returns true, iteration stops
func Print ¶
func Print(value cue.Value, options ...PrintOption) ([]byte, error)
Print print cue.Value
func ToRawString ¶
ToRawString stringify cue.Value without resolving references
Types ¶
type PrintConfig ¶
type PrintConfig struct {
// contains filtered or unexported fields
}
PrintConfig config for printing value
func NewPrintConfig ¶
func NewPrintConfig(options ...PrintOption) *PrintConfig
NewPrintConfig create print config
type PrintFormat ¶
type PrintFormat string
PrintFormat format for printing cue.Value
const ( // PrintFormatJson json PrintFormatJson PrintFormat = "json" // PrintFormatYaml yaml PrintFormatYaml PrintFormat = "yaml" // PrintFormatCue cue PrintFormatCue PrintFormat = "cue" )
type PrintOption ¶
type PrintOption interface {
ApplyTo(*PrintConfig)
}
PrintOption options for printing value