Documentation
¶
Index ¶
- func BuildImport(path string, templates map[string]string) (*build.Instance, error)
- 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 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
Click to show internal directories.
Click to hide internal directories.