Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CAPSTANIGNORE_ALWAYS []string = []string{
"/meta/*", "/mpm-pkg", "/.git", "/.capstanignore", "/.gitignore",
}
Functions ¶
func IsTemplateFile ¶
IsTemplateFile returns true if filename points to a valid template file; otherwise returns false.
func PackageRunManifestGeneral ¶ added in v0.2.0
PackageRunManifestGeneral parses meta/run.yaml file into blank RunConfig. By 'blank' we mean that the struct has no fields populated, but it is of correct type i.e. appropriate implementation of Runtime interface. NOTE: We must differentiate two things regarding Runtime interface implementation:
a) what struct is it implemented with -> e.g. nodeJsRuntime b) what fields is struct populated with -> e.g. nodeJsRuntime.Main For a given meta/run.yaml all config sets get the same (a), but are populated with different values for (b).
NOTE: when Capstan needs to know what packages to require, it needs (a), but
not (b). And this function returns exactly this, (a) without (b).
Types ¶
type Capstanignore ¶ added in v0.2.1
type Capstanignore interface {
LoadFile(path string) error
AddPattern(pattern string) error
PrintPatterns()
IsIgnored(path string) bool
}
func CapstanignoreInit ¶ added in v0.2.1
func CapstanignoreInit(path string) (Capstanignore, error)
CapstanignoreInit creates a new Capstanignore struct that is used when deciding whether a file should be included in unikernel or not. You can provide `path` to the .capstanignore file to load it or pass empty string "" if you have none. Note that once having capstanignore struct you can load as many files as you want (using .LoadFile function) or manually add as many patterns as you like (using .AddPattern function).
type CmdConfig ¶ added in v0.2.0
type CmdConfig struct {
RuntimeType runtime.RuntimeType
ConfigSetDefault string
// ConfigSets is a map of available <config-name>:<runtime> pairs.
// The map is built based on meta/run.yaml.
ConfigSets map[string]runtime.Runtime
}
CmdConfig is a result that parsing meta/run.yaml yields.
func ParsePackageRunManifestData ¶ added in v0.2.0
ParsePackageRunManifestData returns parsed manifest data.
type HashCache ¶ added in v0.2.0
func NewHashCache ¶ added in v0.2.0
func NewHashCache() HashCache
func ParseHashCache ¶ added in v0.2.0
ParseHashCache looks for a file at given location and tries to parse the HashCache config. In case the file does not exist or is not a valid HashCache file, it fails with an error.
func (*HashCache) WriteToFile ¶ added in v0.2.0
type Package ¶ added in v0.2.0
type Package struct {
Name string
Title string
Author string "author,omitempty"
Version string "version,omitempty"
Require []string "require,omitempty"
Binary map[string]string "binary,omitempty"
// ModTime is currently used only for setting the modification time of local
// packages. It is ignored by the YAML parser.
ModTime time.Time "-"
}
func ParsePackageManifest ¶ added in v0.2.0
type RpmPackage ¶
func (*RpmPackage) Download ¶
func (p *RpmPackage) Download() error
func (*RpmPackage) Filename ¶
func (p *RpmPackage) Filename() string
func (*RpmPackage) URL ¶
func (p *RpmPackage) URL() string
type Template ¶
type Template struct {
Base string
RpmBase *RpmPackage "rpm-base"
Cmdline string
Build string
Files map[string]string
Rootfs string
}
A template is a configuration file that describes how to build a VM image. It is usually representeed as a `Capstanfile` file on disk.
func ParseTemplate ¶
ParseTemplate parses a Template from a byte array.
func ReadTemplateFile ¶
ReadTemplateFile parses a Template from a file.