Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StdoutReporter ¶
func StdoutReporter(msg string)
Types ¶
type CueInput ¶
type CueInput struct { InputBase `yaml:",inline"` // Entrypoint refers to a directory containing CUE files. Entrypoint string `yaml:"entrypoint"` // Value represents the CUE value to use as an input. If specified, it // supersedes the Entrypoint option. Value *cue.Value `yaml:"-"` // ForcedEnvelope decorates the parsed cue Value with an envelope whose // name is given. This is useful for dataqueries for example, where the // schema doesn't define any suitable top-level object. ForcedEnvelope string `yaml:"forced_envelope"` // Package name to use for the input schema. If empty, it will be guessed // from the entrypoint. Package string `yaml:"package"` // CueImports allows importing additional libraries. // Format: [path]:[import]. Example: '../grafana/common-library:github.com/grafana/grafana/packages/grafana-schema/src/common CueImports []string `yaml:"cue_imports"` NameFunc simplecue.NameFunc `yaml:"-"` }
type Input ¶
type Input struct { If string `yaml:"if"` JSONSchema *JSONSchemaInput `yaml:"jsonschema"` OpenAPI *OpenAPIInput `yaml:"openapi"` KindRegistry *KindRegistryInput `yaml:"kind_registry"` KindsysCore *CueInput `yaml:"kindsys_core"` KindsysComposable *CueInput `yaml:"kindsys_composable"` Cue *CueInput `yaml:"cue"` }
func (*Input) InterpolateParameters ¶
func (input *Input) InterpolateParameters(interpolator ParametersInterpolator) error
type InputBase ¶
type InputBase struct { // AllowedObjects is a list of object names that will be allowed when // parsing the input schema. // Note: if AllowedObjects is empty, no filter is applied. AllowedObjects []string `yaml:"allowed_objects"` // Transforms holds a list of paths to files containing compiler passes // to apply to the input. Transforms []string `yaml:"transformations"` // Metadata to add to the schema, this can be used to set Kind and Variant Metadata *ast.SchemaMeta `yaml:"metadata"` }
InputBase provides common options and behavior, meant to be re-used across all input types.
type JSONSchemaInput ¶
type JSONSchemaInput struct { InputBase `yaml:",inline"` // Path to a JSONSchema file. Path string `yaml:"path"` // URL to a JSONSchema file. URL string `yaml:"url"` // Package name to use for the input schema. If empty, it will be guessed // from the input file name. Package string `yaml:"package"` }
func (*JSONSchemaInput) LoadSchemas ¶
type KindRegistryInput ¶
type KindRegistryInput struct { InputBase `yaml:",inline"` Path string `yaml:"path"` Version string `yaml:"version"` }
func (*KindRegistryInput) LoadSchemas ¶
type OpenAPIInput ¶
type OpenAPIInput struct { InputBase `yaml:",inline"` // Path to an OpenAPI file. Path string `yaml:"path"` // URL to an OpenAPI file. URL string `yaml:"url"` // Package name to use for the input schema. If empty, it will be guessed // from the input file name. Package string `yaml:"package"` // NoValidate disables validation of the OpenAPI spec. NoValidate bool `yaml:"no_validate"` }
func (*OpenAPIInput) LoadSchemas ¶
type Output ¶
type Output struct { Directory string `yaml:"directory"` Types bool `yaml:"types"` Builders bool `yaml:"builders"` Converters bool `yaml:"converters"` APIReference bool `yaml:"api_reference"` Languages []*OutputLanguage `yaml:"languages"` // RepositoryTemplates is the path to a directory containing // "repository-level templates". // These templates are used to add arbitrary files to the repository, such as CI pipelines. // // Templates in that directory are expected to be organized by language: // “` // repository_templates // ├── go // │ └── .github // │ └── workflows // │ └── go-ci.yaml // └── typescript // └── .github // └── workflows // └── typescript-ci.yaml // “` RepositoryTemplates string `yaml:"repository_templates"` // TemplatesData holds data that will be injected into package and // repository templates when rendering them. TemplatesData map[string]string `yaml:"templates_data"` }
type OutputLanguage ¶
type OutputLanguage struct { Go *golang.Config `yaml:"go"` Java *java.Config `yaml:"java"` JSONSchema *jsonschema.Config `yaml:"jsonschema"` OpenAPI *openapi.Config `yaml:"openapi"` PHP *php.Config `yaml:"php"` Python *python.Config `yaml:"python"` Typescript *typescript.Config `yaml:"typescript"` }
type ParametersInterpolator ¶
type Pipeline ¶
type Pipeline struct { Debug bool `yaml:"debug"` Inputs []*Input `yaml:"inputs"` Transforms Transforms `yaml:"transformations"` Output Output `yaml:"output"` Parameters map[string]string `yaml:"parameters"` // contains filtered or unexported fields }
func NewPipeline ¶
func PipelineFromFile ¶
func PipelineFromFile(file string, opts ...PipelineOption) (*Pipeline, error)
func (*Pipeline) LoadSchemas ¶
type PipelineOption ¶
type PipelineOption func(pipeline *Pipeline)
func Parameters ¶
func Parameters(extraParameters map[string]string) PipelineOption
func Reporter ¶
func Reporter(reporter ProgressReporter) PipelineOption
type ProgressReporter ¶
type ProgressReporter func(msg string)
type Transforms ¶
type Transforms struct { // CommonPassesFiles holds a list of paths to files containing compiler // passes to apply to all the schemas. // Note: these compiler passes are applied *before* language-specific passes. CommonPassesFiles []string `yaml:"schemas"` // CommonPasses holds a list of compiler passes to apply to all the schemas. // If this field is set, CommonPassesFiles is ignored. // Note: these compiler passes are applied *before* language-specific passes. CommonPasses compiler.Passes `yaml:"-"` // FinalPasses holds a list of compiler passes to apply to all the schemas. // Note: these compiler passes are applied *after* language-specific passes. FinalPasses compiler.Passes `yaml:"-"` // VeneersDirectories holds a list of paths to directories containing // veneers to apply to all the builders. VeneersDirectories []string `yaml:"builders"` }
Click to show internal directories.
Click to hide internal directories.