Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnpackInDirectory ¶ added in v0.2.0
UnpackInDirectory will extract files of a pack into a directory.
func WritePackToFile ¶ added in v0.2.0
WritePackToFile will write a Pack to file
Types ¶
type FilesMapType ¶
FilesMapType is useful type to specify what kind of Mapping we are using to store files in the pack.
type Pack ¶ added in v0.2.0
type Pack struct {
Name string `yaml:"name"`
Version string `yaml:"version"` // Please use semver
Dependencies map[string]string `yaml:",omitempty"` // URLs for dependencies? TBD
// Templates are the .nomad files that with DefaultValues to be replaced
Templates FilesMapType `yaml:"-"`
// JobsEvalIDs are used to store the Jobs IDs once the templates are applied
JobsEvalIDs map[string]string `yaml:"-"`
// DefaultValues are the specified as a yaml file. It is a []byte instead of
// ValuesType (map[string]interface{}) because in this way we will preserve
// comments and inline documentation. This can help a lot to getting the right
// configuration before deploying a backpack, without having to deal with
// online documentation versioning.
DefaultValues []byte `yaml:"-"`
// Documentation contains the Markdown files (.md) files. This is used to
// provide additional information when the values.yaml inline doc is not good
// enough due to yaml limits.
Documentation map[string][]byte `yaml:"-"`
// BackpackVersion will help in case the Struct changes over time (as semver)
BackpackVersion string `yaml:"backpack_version,omitempty"`
}
Pack is the structure of the package/file that will use to export, share exchange templates, docs and configuration
func GetPackFromDirectory ¶ added in v0.2.0
GetPackFromDirectory will look in a given path for backpack.yaml and .nomad files to pack them together in a Pack struct.
func GetPackFromFile ¶ added in v0.2.0
GetPackFromFile will read and get a Pack from a file path and return as a Pack struct
func (*Pack) SortTemplates ¶ added in v0.2.0
func (b *Pack) SortTemplates()
SortTemplates is used to ensure that files names sorting is respected. This is useful to define an "order" to follow when applying resources if that is needed.
type ValuesType ¶
type ValuesType map[string]interface{}
ValuesType is the Type for our Values
func ValuesFromFile ¶
func ValuesFromFile(p string) (v ValuesType, err error)
ValuesFromFile reads a path and returns a ValuesType Use this function to allow different formats (yaml, json, msgpack)