types

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrImageDoesNotExist = errors.New("image does not exist")

ErrImageDoesNotExist is returned if source image does not exist.

Functions

func IsNameValid

func IsNameValid(name string) bool

IsNameValid returns true if name is valid.

func RandomString

func RandomString(length int) string

RandomString generates random string of fixed length.

Types

type Boot added in v0.5.0

type Boot struct {
	Title  string
	Params []string
}

Boot represents a boot option for an image.

type BuildID

type BuildID string

BuildID is unique ID of build.

func NewBuildID

func NewBuildID(buildType BuildType) BuildID

NewBuildID returns new random build ID.

func ParseBuildID

func ParseBuildID(strBuildID string) (BuildID, error)

ParseBuildID parses string into build ID and returns error if string is not a valid one.

func (BuildID) IsValid

func (bid BuildID) IsValid() bool

IsValid verifies if format of build ID is valid.

func (BuildID) IsValidType

func (bid BuildID) IsValidType(buildType BuildType) bool

IsValidType verifies if format of build ID is valid and type matches.

func (BuildID) Type

func (bid BuildID) Type() BuildType

Type returns type of build encoded inside build ID.

type BuildInfo

type BuildInfo struct {
	BuildID   BuildID
	BasedOn   BuildID
	CreatedAt time.Time
	Name      string
	Tags      Tags
	Params    Params
	Boots     []Boot
	Mounted   string
}

BuildInfo stores all the information about build.

type BuildKey

type BuildKey struct {
	Name string
	Tag  Tag
}

BuildKey represents Name-Tag pair.

func NewBuildKey

func NewBuildKey(name string, tag Tag) BuildKey

NewBuildKey returns new build key.

func ParseBuildKey

func ParseBuildKey(strBuildKey string) (BuildKey, error)

ParseBuildKey parses string into build key and returns error if string is not a valid one.

func (BuildKey) IsValid

func (bk BuildKey) IsValid() bool

IsValid returns true if build key is valid.

func (BuildKey) String

func (bk BuildKey) String() string

String returns string representation of build key.

type BuildType

type BuildType string

BuildType is the type of build.

const (
	// BuildTypeImage is the image build type.
	BuildTypeImage BuildType = "iid"

	// BuildTypeMount is the mount build type.
	BuildTypeMount BuildType = "mid"

	// BuildTypeBoot is the boot build type.
	BuildTypeBoot BuildType = "bid"

	// BuildTypeVM is the vm build type.
	BuildTypeVM BuildType = "vid"
)

func (BuildType) IsValid

func (bt BuildType) IsValid() bool

IsValid verifies if build type is valid.

func (BuildType) Properties

func (bt BuildType) Properties() BuildTypeProperties

Properties returns properties of build type.

type BuildTypeProperties

type BuildTypeProperties struct {
	// Cloneable means image may be cloned.
	Cloneable bool

	// Revertable means image might be reverted to original state.
	Revertable bool

	// Mountable means image can't be mounted.
	Mountable bool

	// AutoMount means image is automatically mounted.
	AutoMount bool

	// VM means vm in libvirt is defined for this image.
	VM bool
}

BuildTypeProperties contains properties of build type.

type ImageManifest

type ImageManifest struct {
	BuildID BuildID
	BasedOn BuildID
	Params  Params
	Boots   []Boot
}

ImageManifest contains info about built image.

type Params

type Params []string

Params is a list of params configured on image.

func (Params) String

func (p Params) String() string

type Tag

type Tag string

Tag is the tag of build.

func (Tag) IsValid

func (t Tag) IsValid() bool

IsValid returns true if tag is valid.

type Tags

type Tags []Tag

Tags is a sortable representation of slice of tags.

func (Tags) String

func (t Tags) String() string

Jump to

Keyboard shortcuts

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