core

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContainerfile

func BuildContainerfile(recipe *api.Recipe) error

BuildContainerfile builds a Containerfile from a recipe and a list of modules commands

func BuildModule

func BuildModule(recipe *api.Recipe, moduleInterface interface{}) (string, error)

BuildModule builds a module command from a module this is done by calling the appropriate module builder function based on the module type

func BuildRecipe

func BuildRecipe(recipePath string) (api.Recipe, error)

BuildRecipe builds a Containerfile from a recipe path

func BuildShellModule added in v0.2.1

func BuildShellModule(moduleInterface interface{}, recipe *api.Recipe) (string, error)

func ChangeWorkingDirectory added in v0.7.3

func ChangeWorkingDirectory(workdir string, containerfile *os.File) error

func CompileRecipe added in v0.2.4

func CompileRecipe(recipePath string, runtime string, isRoot bool, origGid int, origUid int) error

CompileRecipe compiles a recipe into a runnable image.

func GenModule added in v0.2.0

func GenModule(modulePath string) (map[string]interface{}, error)

GenModule generate a Module struct from a module path

func GetContainerStorage added in v0.8.0

func GetContainerStorage(runtime string) (cstorage.Store, error)

func GetImageID added in v0.8.0

func GetImageID(name string, store cstorage.Store) (string, error)

func GetTopLayerID added in v0.8.0

func GetTopLayerID(imageid string, store cstorage.Store) (string, error)

func LoadRecipe

func LoadRecipe(path string) (*api.Recipe, error)

LoadRecipe loads a recipe from a file and returns a Recipe Does not validate the recipe but it will catch some errors a proper validation will be done in the future

func MountImage added in v0.8.0

func MountImage(imagename string, imageid string, runtime string) (string, error)

func RestoreWorkingDirectory added in v0.7.3

func RestoreWorkingDirectory(workdir string, containerfile *os.File) error

func TestRecipe added in v0.5.0

func TestRecipe(path string) (*api.Recipe, error)

TestRecipe validates a recipe by loading it and checking for errors

Types

type Finalize added in v0.8.0

type Finalize struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Content []byte // The entire module unparsed as a []byte, used by plugins
}

type IncludesModule added in v0.3.2

type IncludesModule struct {
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	Includes []string `json:"includes"`
}

type Module

type Module struct {
	Name    string `json:"name"`
	Workdir string
	Type    string `json:"type"`
	Modules []map[string]interface{}
	Content []byte // The entire module unparsed as a []byte, used by plugins
}

type ModuleCommand

type ModuleCommand struct {
	Name    string
	Command string
	Workdir string
}

func BuildModules

func BuildModules(recipe *api.Recipe, modules []interface{}) ([]ModuleCommand, error)

BuildModules builds a list of modules commands from a list of modules

type Plugin added in v0.3.2

type Plugin struct {
	Name         string
	BuildFunc    func(*C.char, *C.char) string
	LoadedPlugin uintptr
}

type ShellModule added in v0.3.2

type ShellModule struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Source   api.Source
	Commands []string
}

type StorageConf added in v0.8.0

type StorageConf struct {
	Driver    string
	Runroot   string
	Graphroot string
}

Jump to

Keyboard shortcuts

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