cicci

package
v0.0.0-...-8c0ffa3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 14 Imported by: 0

README

cicci - cloud config merging toolkit

Responsibilities of this package

  1. Collect files (yaml + shell)
  2. Expand templates (with the help of the environment and masterminds.github.io/sprig)
  3. Validate shell scripts and cloud-config files
  4. Generate a multi-part archive

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMultipartArchive

func CreateMultipartArchive(files []ExpandedFile) (string, error)

func ExpandTemplate

func ExpandTemplate(name, tpl string, extraKeys map[string]string) (string, error)

func ValidateCloudConfig

func ValidateCloudConfig(payload string) error

func ValidateScript

func ValidateScript(filename, payload string) error

Types

type CCFile

type CCFile string

func (*CCFile) IsScript

func (f *CCFile) IsScript() bool

func (*CCFile) IsTemplate

func (f *CCFile) IsTemplate() bool

func (*CCFile) Load

func (f *CCFile) Load() (string, error)

func (*CCFile) LoadAndExpand

func (f *CCFile) LoadAndExpand(extraKeys map[string]string) (ExpandedFile, error)

func (*CCFile) NonTemplateName

func (f *CCFile) NonTemplateName() string

type CCFiles

type CCFiles []CCFile

func CollectFiles

func CollectFiles(inputs []string) (CCFiles, error)

func (CCFiles) LoadAndExpand

func (files CCFiles) LoadAndExpand(extraKeys map[string]string) (result ExpandedFiles, err error)

type ExpandedFile

type ExpandedFile struct {
	OriginalFilename string
	Filename         string
	Content          string
	IsScript         bool
	IsTemplate       bool
}

func (*ExpandedFile) Validate

func (e *ExpandedFile) Validate() error

type ExpandedFiles

type ExpandedFiles []ExpandedFile

func (ExpandedFiles) Validate

func (s ExpandedFiles) Validate() (result []error)

Jump to

Keyboard shortcuts

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