schema

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeconfigDefaultApiVersion = "client.authentication.k8s.io/v1beta1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Type   string                 `json:"type"`
	Config map[string]interface{} `json:"config"`
}

type Component

type Component struct {
	Stack     string                 `json:"stack"`
	Backend   Backend                `json:"backend"`
	Appends   map[string][]string    `json:"appends"`
	Name      string                 `json:"name"`
	Path      string                 `json:"path"`
	Inputs    map[string]interface{} `json:"inputs"`
	Providers map[string]interface{} `json:"providers"`
}

func (*Component) EnsurePath added in v0.1.0

func (c *Component) EnsurePath(config *Config, copy bool) error

copy component to workdir if needed

func (*Component) PropertyRef added in v0.1.0

func (c *Component) PropertyRef(property string) string

property ref template to resolve later

func (*Component) ResolveVars added in v0.1.0

func (c *Component) ResolveVars(config *Config, stacks *Stacks, executor Executor) error

resolve templates in component

type Config

type Config struct {
	LogLevel        string `mapstructure:"log_level"`
	Command         string `mapstructure:"tf_command"`
	StacksDir       string `mapstructure:"stacks_dir"`
	WorkDir         string `mapstructure:"work_dir"`
	GenerateBackend bool   `mapstructure:"generate_backend"`
}

type Executor added in v0.1.0

type Executor interface {
	Plan(component *Component) (bool, error)
	Apply(component *Component) error
	Destroy(component *Component) error
	Output(component *Component) (map[string]*OutputMeta, error)
}

type KubeconfgCluster added in v0.3.0

type KubeconfgCluster struct {
	Context        string   `json:"context"`
	Host           string   `json:"host"`
	Cert           string   `json:"cert"`
	ExecApiVersion string   `json:"exec_apiversion"`
	ExecCommand    string   `json:"exec_command"`
	ExecArgs       []string `json:"exec_args"`
}

type Kubeconfig added in v0.3.0

type Kubeconfig struct {
	Current  int                 `json:"current"`
	Clusters []*KubeconfgCluster `json:"clusters"`
}

func (*Kubeconfig) Render added in v0.3.0

func (k *Kubeconfig) Render(config *Config, stacks *Stacks, executor Executor, stackName string) (string, error)

type OutputMeta added in v0.0.2

type OutputMeta struct {
	Sensitive bool            `json:"sensitive"`
	Type      json.RawMessage `json:"type"`
	Value     json.RawMessage `json:"value"`
}

func (*OutputMeta) String added in v0.1.0

func (o *OutputMeta) String() string

type Parser added in v0.1.0

type Parser interface {
	Parse(path string) (*Stack, error)
}

type Stack

type Stack struct {
	Path       string              `json:"path"`
	Type       string              `json:"type"`
	Name       string              `json:"name"`
	Options    any                 `json:"options"`
	Backend    Backend             `json:"backend"`
	Appends    map[string][]string `json:"appends"`
	Components []*Component        `json:"components"`
	Kubeconfig *Kubeconfig         `json:"kubeconfig"`
}

func NewStack

func NewStack(path string, t string) *Stack

func (*Stack) AddComponent

func (s *Stack) AddComponent(name, path string, inputs map[string]interface{}, providers map[string]interface{}) *Component

func (*Stack) GetComponent added in v0.1.0

func (s *Stack) GetComponent(name string) (*Component, error)

func (*Stack) GetComponents added in v0.1.0

func (s *Stack) GetComponents(filterName string) ([]*Component, error)

func (*Stack) Valid

func (s *Stack) Valid() bool

type Stacks

type Stacks struct {
	// contains filtered or unexported fields
}

func (*Stacks) AddStack

func (s *Stacks) AddStack(stack *Stack) error

func (*Stacks) GetStack

func (s *Stacks) GetStack(name string) (*Stack, error)

func (*Stacks) OrderByName

func (s *Stacks) OrderByName() []*Stack

type Templater added in v0.3.0

type Templater struct {
	// contains filtered or unexported fields
}

func NewTemplater added in v0.3.0

func NewTemplater(config *Config, stacks *Stacks, executor Executor, stackName string) (*Templater, error)

func (*Templater) Any added in v0.3.0

func (t *Templater) Any(v any, data any) error

func (*Templater) Execute added in v0.3.0

func (t *Templater) Execute(src any, dst any, data any) error

func (*Templater) Map added in v0.3.0

func (t *Templater) Map(src any, data any) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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