package internal

import "cuelang.org/go/internal/filetypes/internal"

Package internal holds some internal parts of the filetypes package that need to be shared between the code generator and the package proper.

Index

Types

type Aspects

type Aspects uint64
const (
	Definitions Aspects = 1 << iota
	Data
	Optional
	Constraints
	References
	Cycles
	KeepDefaults
	Incomplete
	Imports
	Stream
	Docs
	Attributes

	AllAspects Aspects = (1 << iota) - 1
)

type ErrorKind

type ErrorKind int
const (
	ErrNoError ErrorKind = iota
	ErrUnknownFileExtension
	ErrCouldNotDetermineFileType
	ErrNoEncodingSpecified
	NumErrorKinds
)

type FileInfo

type FileInfo struct {
	Filename       string               `json:"filename"`
	Encoding       build.Encoding       `json:"encoding,omitempty"`
	Interpretation build.Interpretation `json:"interpretation,omitempty"`
	Form           build.Form           `json:"form,omitempty"`

	Definitions  bool `json:"definitions"`  // include/allow definition fields
	Data         bool `json:"data"`         // include/allow regular fields
	Optional     bool `json:"optional"`     // include/allow definition fields
	Constraints  bool `json:"constraints"`  // include/allow constraints
	References   bool `json:"references"`   // don't resolve/allow references
	Cycles       bool `json:"cycles"`       // cycles are permitted
	KeepDefaults bool `json:"keepDefaults"` // select/allow default values
	Incomplete   bool `json:"incomplete"`   // permit incomplete values
	Imports      bool `json:"imports"`      // don't expand/allow imports
	Stream       bool `json:"stream"`       // permit streaming
	Docs         bool `json:"docs"`         // show/allow docs
	Attributes   bool `json:"attributes"`   // include/allow attributes
}

FileInfo defines the parsing plan for a file.

func (FileInfo) Aspects

func (f FileInfo) Aspects() Aspects

func (*FileInfo) SetAspects

func (f *FileInfo) SetAspects(a Aspects)

Source Files

internal.go

Directories

PathSynopsis
internal/filetypes/internal/genfunc
internal/filetypes/internal/genstructPackage genstruct provides support for simple compact struct representations.
internal/filetypes/internal/opt
Version
v0.13.0-rc.1
Published
May 16, 2025
Platform
js/wasm
Imports
1 packages
Last checked
4 hours ago

Tools for package owners.