templating

package
v0.1.143 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).

Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).

Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).

Index

Constants

View Source
const (
	TemplateYAMLName    = "template.outblocks"
	TemplateProjectName = "template.outblocks.project"
	TemplateValuesName  = "template.outblocks.values"
	TemplateValuesJSON  = "template.outblocks.values.json"
	TemplateProjectJSON = "template.outblocks.project.json"
)

Variables

View Source
var ErrMissingMetadata = errors.New("template metadata (template.outblocks.yaml) missing")
View Source
var (
	TemplateTypes = []string{"project"}
)

Functions

This section is empty.

Types

type Installer

type Installer interface {
	Download() error
	CopyTo(dest string) error
}

func NewInstaller

func NewInstaller(source, version string) (Installer, error)

type LocalInstaller

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

func NewLocalInstaller

func NewLocalInstaller(source string) (*LocalInstaller, error)

func (*LocalInstaller) CopyTo

func (b *LocalInstaller) CopyTo(dest string) error

func (*LocalInstaller) Download

func (i *LocalInstaller) Download() error

type Template

type Template struct {
	Type          string   `json:"type"`
	TemplateFiles []string `json:"template_files"`

	Project *TemplateProject
	Values  *TemplateValues
	// contains filtered or unexported fields
}

func LoadTemplate

func LoadTemplate(dir string) (*Template, error)

func (*Template) HasProjectPrompt

func (t *Template) HasProjectPrompt() bool

func (*Template) HasValuesPrompt

func (t *Template) HasValuesPrompt() bool

func (*Template) ParseProjectTemplate

func (t *Template) ParseProjectTemplate(projectName string, input map[string]interface{}) error

func (*Template) ParseValuesTemplate

func (t *Template) ParseValuesTemplate(input map[string]interface{}) ([]byte, error)

func (*Template) Validate

func (t *Template) Validate() error

type TemplateProject

type TemplateProject struct {
	Plugins      []*config.Plugin              `json:"plugins"`
	Dependencies map[string]*config.Dependency `json:"dependencies"`
	DNS          []*config.DNS                 `json:"dns"`
	// contains filtered or unexported fields
}

type TemplateValues

type TemplateValues struct {
	Val map[string]interface{}
}

type VCSInstaller

type VCSInstaller struct {
	Repo    vcs.Repo
	Version string
	// contains filtered or unexported fields
}

func NewVCSInstaller

func NewVCSInstaller(source, version string) (*VCSInstaller, error)

func (*VCSInstaller) CopyTo

func (b *VCSInstaller) CopyTo(dest string) error

func (*VCSInstaller) Download

func (i *VCSInstaller) Download() error

Jump to

Keyboard shortcuts

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