Documentation ¶
Index ¶
- type File
- func (f *File) Comments() string
- func (f *File) Eval() (*File, error)
- func (f *File) EvalWithoutPrivateFields() (*File, error)
- func (f *File) Format() ([]byte, error)
- func (f *File) Merge(schema *File, parents ...cue.Selector) (*File, error)
- func (f *File) Sanitize() error
- func (f *File) SchemaVersion() (string, error)
- func (f *File) Unify(files []*File) (*File, error)
- func (f *File) Validate(schema *File) error
- func (f *File) Vet() error
- func (f *File) Yaml() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Name string // contains filtered or unexported fields }
File is a wrapper around a cue file. It provides methods for working with cue files.
func New ¶
New creates a new File from a cue file. src must be a string, []byte, or io.Reader. if src is nil, the file is read from filepath.
func (*File) Comments ¶
Comments returns the comments of the top Node of the cue file. It returns an empty string if there are no comments.
func (*File) Eval ¶
Eval evaluates the cue file. It expects the cue file to be well formed. Optional fields and attributes are removed.
func (*File) EvalWithoutPrivateFields ¶
EvalWithoutPrivateFields evaluates the cue file and removes any private fields. note: calling Eval() after Eval() EvalWithoutPrivateFields() will add the private fields back while removing the attributes.
func (*File) Merge ¶
Merge merges the schema with the data. It strip any private fields from the schema.
func (*File) SchemaVersion ¶
SchemaVersion returns the schema version of the cue file.
func (*File) Unify ¶
Unify merges several cue files into one. Unify reports the greatest lower bound of the given files.