config

package
v0.0.0-...-32759e4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepoPath  = "repo.d"
	ImagePath = "image.d"
	TplPath   = "tpl.d"
	CfgPath   = "cfg.d"
)

Variables

View Source
var ZshHelper = `` /* 891-byte string literal not displayed */

Functions

func InstallPrefix

func InstallPrefix() (string, error)

Types

type Config

type Config struct {
	Namespace string     `hcl:"namespace,label"`
	Profiles  []*Profile `hcl:"profile,block"`
}

func (*Config) ToHclFile

func (c *Config) ToHclFile() *hclwrite.File

type ConfigFile

type ConfigFile struct {
	Configs *Config `hcl:"Config,block"`
}

type FetchConfig

type FetchConfig struct {
	Uri       *url.URL
	UriString string `hcl:"uri"`
}

type ImageConfig

type ImageConfig struct {
	Name string `hcl:"name"`
	Path string `hcl:"path"`
	Os   string `hcl:"os"`
	Arch string `hcl:"arch"`
}

func (*ImageConfig) ToHclFile

func (i *ImageConfig) ToHclFile() *hclwrite.File

type ImageFile

type ImageFile struct {
	Name string `hcl:"name"`
	Path string `hcl:"path,optional"`
	Os   string `hcl:"os,optional"`
	Arch string `hcl:"arch,optional"`

	Repos     []*RepoConfig  `hcl:"Repo,block"`
	Configs   []*Config      `hcl:"Config,block"`
	Templates []*TplConfig   `hcl:"Template,block"`
	Packages  []*PkgConfig   `hcl:"Package,block"`
	Trusts    []*TrustConfig `hcl:"Trust,block"`

	FilePath string
}

func (*ImageFile) Load

func (i *ImageFile) Load(imageFilePath string) error

type PkgConfig

type PkgConfig struct {
	Name      string `hcl:"name,label"`
	Operation string `hcl:"operation,optional"`
	Version   string `hcl:"version,optional"`
}

type Profile

type Profile struct {
	Name   string    `hcl:"name,label"`
	Values cty.Value `hcl:"values"`
}

type PublishConfig

type PublishConfig struct {
	Uri           *url.URL
	UriString     string `hcl:"uri"`
	Name          string `hcl:"name"`
	Prune         int    `hcl:"prune"`
	LockUri       *url.URL
	LockUriString string `hcl:"lock_uri,optional"`
}

type RepoConfig

type RepoConfig struct {
	// Used only for Imagefile
	Name string `hcl:"name,label"`

	Priority int  `hcl:"priority"`
	Enabled  bool `hcl:"enabled"`

	Channels []string `hcl:"channels,optional"`

	Fetch   *FetchConfig   `hcl:"fetch,block"`
	Publish *PublishConfig `hcl:"publish,block"`
}

func (*RepoConfig) ToHclFile

func (r *RepoConfig) ToHclFile() *hclwrite.File

Sadly there is no way yet to dump a struct to HCL so when the struct changes we have to update the HCL encoding

type TplConfig

type TplConfig struct {
	Name     string `hcl:"name,label"`
	Register string `hcl:"register"`
	Source   string `hcl:"source"`
	Output   string `hcl:"output"`

	Owner string `hcl:"owner,optional"`
	Group string `hcl:"group,optional"`
	Mode  string `hcl:"mode,optional"`
}

func (TplConfig) ToHclFile

func (t TplConfig) ToHclFile() *hclwrite.File

type TplConfigFile

type TplConfigFile struct {
	Templates *TplConfig `hcl:"Template,block"`
}

type TrustConfig

type TrustConfig struct {
	Publisher string `hcl:"publisher,label"`
	Uri       string `hcl:"uri"`
}

type ZpsConfig

type ZpsConfig struct {
	Mode     string `hcl:"mode"`
	Security string `hcl:"security"`

	Root         string
	CurrentImage *ImageConfig

	Configs   []*Config
	Images    []*ImageConfig
	Repos     []*RepoConfig
	Templates []*TplConfig
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(image string) (*ZpsConfig, error)

func (*ZpsConfig) CachePath

func (z *ZpsConfig) CachePath() string

func (*ZpsConfig) CertPath

func (z *ZpsConfig) CertPath() string

func (*ZpsConfig) CloudProvider

func (z *ZpsConfig) CloudProvider() string

func (*ZpsConfig) ConfigForImage

func (z *ZpsConfig) ConfigForImage(imagePath string) string

func (*ZpsConfig) ConfigPath

func (z *ZpsConfig) ConfigPath() string

func (*ZpsConfig) HclContext

func (z *ZpsConfig) HclContext(profile string) *hcl.EvalContext

func (*ZpsConfig) LoadConfigs

func (z *ZpsConfig) LoadConfigs() error

func (*ZpsConfig) LoadHclContext

func (z *ZpsConfig) LoadHclContext() error

func (*ZpsConfig) LoadImages

func (z *ZpsConfig) LoadImages() error

func (*ZpsConfig) LoadMain

func (z *ZpsConfig) LoadMain() error

func (*ZpsConfig) LoadRepos

func (z *ZpsConfig) LoadRepos() error

func (*ZpsConfig) LoadTemplates

func (z *ZpsConfig) LoadTemplates() error

func (*ZpsConfig) LockPath

func (z *ZpsConfig) LockPath() string

func (*ZpsConfig) PkiPath

func (z *ZpsConfig) PkiPath() string

func (*ZpsConfig) SelectImage

func (z *ZpsConfig) SelectImage(image string) error

func (*ZpsConfig) SetRoot

func (z *ZpsConfig) SetRoot() error

func (*ZpsConfig) SetupHelper

func (z *ZpsConfig) SetupHelper(overwrite bool) error

func (*ZpsConfig) StatePath

func (z *ZpsConfig) StatePath() string

func (*ZpsConfig) TemplatesForPkg

func (z *ZpsConfig) TemplatesForPkg(pkg string) []*TplConfig

func (*ZpsConfig) UserPath

func (z *ZpsConfig) UserPath() string

func (*ZpsConfig) WorkPath

func (z *ZpsConfig) WorkPath() string

Jump to

Keyboard shortcuts

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