jetpack

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2015 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContainerIsEmpty = errors.New("Container is empty")
View Source
var ErrManyFound = stderrors.New("Multiple results found")
View Source
var ErrNotFound = stderrors.New("Not found")
View Source
var NoJailStatus = JailStatus{}

Functions

func ConsoleApp

func ConsoleApp(username string) *types.App

func DecompressingReader

func DecompressingReader(rd io.Reader) (io.Reader, error)

FIXME: mostly copy/paste from github.com/appc/spec/actool/validate.go

func UnpackImage

func UnpackImage(uri, path, saveAmiPath string) (hsh *types.Hash, err error)

Types

type Container

type Container struct {
	Dataset  *zfs.Dataset                    `json:"-"`
	Manifest schema.ContainerRuntimeManifest `json:"-"`
	Manager  *ContainerManager               `json:"-"`
	// contains filtered or unexported fields
}

func GetContainer

func GetContainer(ds *zfs.Dataset, mgr *ContainerManager) (*Container, error)

func NewContainer

func NewContainer(ds *zfs.Dataset, mgr *ContainerManager) *Container

func (*Container) Destroy

func (c *Container) Destroy() error

func (*Container) GetImage

func (c *Container) GetImage() (*Image, error)

func (*Container) GetJailStatus

func (c *Container) GetJailStatus(refresh bool) (JailStatus, error)

func (*Container) IsEmpty

func (c *Container) IsEmpty() bool

func (*Container) IsLoaded

func (c *Container) IsLoaded() bool

func (*Container) JailName

func (c *Container) JailName() string

func (*Container) Jid

func (c *Container) Jid() int

func (*Container) Kill

func (c *Container) Kill() error

func (*Container) Load

func (c *Container) Load() error

func (*Container) Prep

func (c *Container) Prep() error

func (*Container) Run

func (c *Container) Run(app *types.App) (err1 error)

func (*Container) Save

func (c *Container) Save() error

func (*Container) Spawn

func (c *Container) Spawn() error

func (*Container) Stage2

func (c *Container) Stage2(app *types.App) error

func (*Container) Status

func (c *Container) Status() ContainerStatus

type ContainerManager

type ContainerManager struct {
	Dataset *zfs.Dataset `json:"-"`
	Host    *Host        `json:"-"`
}

func (*ContainerManager) All

func (cmgr *ContainerManager) All() (ContainerSlice, error)

func (*ContainerManager) Clone

func (cmgr *ContainerManager) Clone(img *Image) (*Container, error)

func (*ContainerManager) Get

func (cmgr *ContainerManager) Get(spec interface{}) (*Container, error)

type ContainerSlice

type ContainerSlice []*Container

func (ContainerSlice) Len

func (cc ContainerSlice) Len() int

func (ContainerSlice) Less

func (cc ContainerSlice) Less(i, j int) bool

func (ContainerSlice) Swap

func (cc ContainerSlice) Swap(i, j int)

func (ContainerSlice) Table

func (cc ContainerSlice) Table() [][]string

type ContainerStatus

type ContainerStatus uint
const (
	ContainerStatusInvalid ContainerStatus = iota
	ContainerStatusRunning
	ContainerStatusDying
	ContainerStatusStopped
)

func (ContainerStatus) String

func (cs ContainerStatus) String() string

type Destroyable

type Destroyable interface {
	Destroy() error
}

type Host

type Host struct {
	Dataset    *zfs.Dataset `json:"-"`
	Images     ImageManager
	Containers ContainerManager

	Properties *properties.Properties
	// contains filtered or unexported fields
}

func NewHost

func NewHost(configPath string) (*Host, error)

func (*Host) Get

func (h *Host) Get(spec interface{}) (interface{}, error)

func (*Host) GetJailStatus

func (h *Host) GetJailStatus(name string, refresh bool) (JailStatus, error)

func (*Host) Initialize

func (h *Host) Initialize() error

type Image

type Image struct {
	Dataset  *zfs.Dataset         `json:"-"`
	Manager  *ImageManager        `json:"-"`
	Manifest schema.ImageManifest `json:"-"`

	UUID uuid.UUID `json:"-"`

	Hash      *types.Hash `json:",omitempty"`
	Origin    string
	Timestamp time.Time
}

func GetImage

func GetImage(ds *zfs.Dataset, mgr *ImageManager) (img *Image, err error)

func NewImage

func NewImage(ds *zfs.Dataset, mgr *ImageManager) (*Image, error)

func (*Image) Build

func (img *Image) Build(buildDir string, addFiles []string, buildExec []string) (*Image, error)

func (*Image) Clone

func (img *Image) Clone(snapshot, dest string) (*zfs.Dataset, error)

func (*Image) Containers

func (img *Image) Containers() (children ContainerSlice, _ error)

func (*Image) Destroy

func (img *Image) Destroy() (err error)

func (*Image) GetApp

func (img *Image) GetApp() *types.App

func (*Image) IsEmpty

func (img *Image) IsEmpty() bool

func (*Image) Load

func (img *Image) Load() error

func (*Image) LoadManifest

func (img *Image) LoadManifest() error

func (*Image) PrettyLabels

func (img *Image) PrettyLabels() imageLabels

func (*Image) Run

func (img *Image) Run(app *types.App, keep bool) (err1 error)

func (*Image) RuntimeApp

func (img *Image) RuntimeApp() schema.RuntimeApp

func (*Image) Seal

func (img *Image) Seal() error

type ImageManager

type ImageManager struct {
	Dataset *zfs.Dataset `json:"-"`
	Host    *Host        `json:"-"`
}

func (*ImageManager) All

func (imgr *ImageManager) All() (ImageSlice, error)

func (*ImageManager) Create

func (imgr *ImageManager) Create() (*Image, error)

func (*ImageManager) Find

func (imgr *ImageManager) Find(query string) (ImageSlice, error)

func (*ImageManager) Find1

func (imgr *ImageManager) Find1(query string) (*Image, error)

func (*ImageManager) Get

func (imgr *ImageManager) Get(spec interface{}) (*Image, error)

func (*ImageManager) Import

func (imgr *ImageManager) Import(imageUri, manifestUri string) (*Image, error)

type ImageSlice

type ImageSlice []*Image

For sorting

func (ImageSlice) Len

func (ii ImageSlice) Len() int

func (ImageSlice) Less

func (ii ImageSlice) Less(i, j int) bool

func (ImageSlice) Swap

func (ii ImageSlice) Swap(i, j int)

func (ImageSlice) Table

func (ii ImageSlice) Table() [][]string

type JailStatus

type JailStatus struct {
	Jid   int
	Dying bool
}

Jump to

Keyboard shortcuts

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