generator

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package generator contains all codes about the Spec generator mechanism. It is a feature about kusionctl that can make Kusion more general in generating Spec and decoupled with KCLVM. Any generator implements the generator interface can be integrated in Kusion operation workflow.

This mechanism is very meaningful to Kusion and makes the foundation to support other languages in the feature.

Index

Constants

View Source
const (
	Kubernetes = "Kubernetes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	GenerateSpec(o *Options, stack *projectstack.Stack) (*models.Spec, error)
}

Generator represents a way to generate Spec. Usually, it is implemented by KCL, but we make it as an interface for a more general usage. Anyone who implements this interface is regarded as a Generator, and can be integrated by the Kusion workflow.

type Options

type Options struct {
	// WorkDir represent the filesystem path where the operation is invoked
	WorkDir string

	// Filenames represent all file names included in this operation
	Filenames []string

	// Settings are setting args stored in the setting.yaml
	Settings []string

	// Arguments are args used for a specified Generator. All Generator related args should be passed through this field
	Arguments []string

	// Overrides contains all override args of this operation
	Overrides []string

	// todo move this field to args
	// DisableNone is the kclvm option. It is not appropriate to put it here
	DisableNone bool

	// todo move this field to args
	// OverrideAST is the kclvm option. It is not appropriate to put it here
	OverrideAST bool

	// NoStyle represent whether turn on the spinner output style
	NoStyle bool
}

Directories

Path Synopsis
kcl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL