template

package
v0.0.0-...-744e601 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerImageWriter

type DockerImageWriter struct{}

func (*DockerImageWriter) Write

func (w *DockerImageWriter) Write(p []byte) (n int, err error)

type DockerStatusMessage

type DockerStatusMessage struct {
	Status         string         `json:"status"`
	ID             string         `json:"id"`
	ProgressDetail ProgressDetail `json:"progressDetail"`
	Progress       string         `json:"progress"`
}

type FileType

type FileType int8
const (
	JSON FileType = iota
	YAML
)

type MetaTemplate

type MetaTemplate struct {
	Templates []*Template        `json:"templates" yaml:"templates"`
	Schema    *jsonschema.Schema `json:"schema" yaml:"schema"`
}

func NewTemplate

func NewTemplate(fs afero.Fs, uri string) (*MetaTemplate, error)

func (*MetaTemplate) ValidateInput

func (t *MetaTemplate) ValidateInput(input *map[string]interface{}) error

type ProgressDetail

type ProgressDetail struct {
	Current uint64 `json:"current"`
	Total   uint64 `json:"total"`
}

type Step

type Step struct {
	ID          string                 `json:"id" yaml:"id"`
	Description string                 `json:"description" yaml:"description"`
	Action      string                 `json:"action" yaml:"action"`
	Target      string                 `json:"target" yaml:"target"`
	Command     []string               `json:"command" yaml:"command"`
	Source      string                 `json:"source" yaml:"source"`
	Inputs      map[string]interface{} `json:"inputs" yaml:"inputs"`
}

type Template

type Template struct {
	URI       string          `json:"uri" yaml:"uri"`
	LocalPath string          `json:"localPath" yaml:"localPath"`
	Version   string          `json:"version" yaml:"version"`
	Config    *TemplateConfig `json:"config" yaml:"config"`
	Steps     []Step          `json:"steps" yaml:"steps"`
}

func (*Template) ExecuteSteps

func (t *Template) ExecuteSteps(input *map[string]interface{}, fs afero.Fs, outputFs afero.Fs) ([]string, []error)

type TemplateConfig

type TemplateConfig struct {
	Title       string      `json:"title" yaml:"title"`
	Version     string      `json:"version" yaml:"version"`
	Description string      `json:"description" yaml:"description"`
	Tags        []string    `json:"tags" yaml:"tags"`
	Icon        string      `json:"icon" yaml:"icon"`
	RawSchema   interface{} `json:"schema" yaml:"schema"`
	Steps       []Step      `json:"steps" yaml:"steps"`
}

func LoadConfig

func LoadConfig(fs afero.Fs) (*TemplateConfig, error)

func (*TemplateConfig) Validate

func (config *TemplateConfig) Validate() error

Jump to

Keyboard shortcuts

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