domain

package
v0.0.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyName           = errors.New("domain name can not be empty")
	ErrMissingImage        = errors.New("image path can not be empty")
	ErrNotEnoughDisk       = errors.New("not enough disk space assigned to task")
	ErrNoCPUS              = errors.New("no cpus configured, use resources.cores to assign cores in the job spec")
	ErrNotEnoughMemory     = errors.New("not enough memory assigned to task")
	ErrIncompleteOSVariant = errors.New("provided os information is incomplete: arch and machine are mandatory ")
	ErrInvalidHostName     = fmt.Errorf("a resource name must consist of lower case alphanumeric characters or '-', must start and end with an alphanumeric character and be less than %d characters", maxNameLength+1)
	ErrPathNotAllowed      = fmt.Errorf("base_image is not in the allowed paths")
)

Functions

func IsValidLabel

func IsValidLabel(name string) bool

IsValidLabel returns true if the string given is a valid DNS label (RFC 1123). Note: the only difference between RFC 1035 and RFC 1123 labels is that in RFC 1123 labels can begin with a number.

func ValidateHostName

func ValidateHostName(name string) error

ValidateHostName returns an error a name is not a valid resource name. The error will contain reference to what constitutes a valid resource name.

Types

type Config

type Config struct {
	RemoveConfigFiles bool
	XMLConfig         string
	Name              string
	Memory            uint
	CPUset            string
	CPUs              uint
	OsVariant         *OSVariant
	BaseImage         string
	DiskFmt           string
	PrimaryDiskSize   uint64
	HostName          string
	Timezone          *time.Location
	Mounts            []MountFileConfig
	Files             []File
	SSHKey            string
	Password          string
	CMDs              []string
	BOOTCMDs          []string
	CIUserData        string

	NetworkInterfaces net.NetworkInterfacesConfig
}

func (*Config) Copy

func (dc *Config) Copy() *Config

func (*Config) Validate

func (dc *Config) Validate(allowedPaths []string) error

type File

type File struct {
	Path        string
	Content     string
	Permissions string
	Encoding    string
	Owner       string
	Group       string
}

type Info

type Info struct {
	State     string
	Memory    uint64
	CPUTime   uint64
	MaxMemory uint64
	NrVirtCPU uint
}

type MountFileConfig

type MountFileConfig struct {
	Source      string
	Destination string
	ReadOnly    bool
	Tag         string
}

type NetworkInterface

type NetworkInterface struct {
	NetworkName string
	Address     string
	PortMap     map[string]string
}

type OSVariant

type OSVariant struct {
	Arch    string
	Machine string
}

type VirtualizerInfo

type VirtualizerInfo struct {
	Model           string
	Memory          uint64
	FreeMemory      uint64
	Cpus            uint
	Cores           uint32
	EmulatorVersion uint32
	LibvirtVersion  uint32
	RunningDomains  uint
	InactiveDomains uint
	StoragePools    uint
}

Jump to

Keyboard shortcuts

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