Documentation ¶
Index ¶
- Constants
- Variables
- func CreateEventFolder(tag string) error
- func CreateFileTransferRoot(path string) error
- func CreateFolderLink(vm string, envTag string, guacUsername string) error
- func CreateUserFolder(teamId string, eventTag string) error
- func GetAvailablePort() uint
- func GetContainerCount() (uint32, error)
- func GetRunningVmCount() (uint32, error)
- func RemoveEventFolder(eventTag string) error
- func VBoxCmdContext(ctx context.Context, cmd string, cmds ...string) ([]byte, error)
- type Container
- func (c *Container) BridgeAlias(alias string) (string, error)
- func (c *Container) Close() error
- func (c *Container) Create(ctx context.Context) error
- func (c *Container) Info() InstanceInfo
- func (c *Container) Run(ctx context.Context) error
- func (c *Container) Start(ctx context.Context) error
- func (c *Container) Stop() error
- func (c *Container) Suspend(ctx context.Context) error
- type ContainerConfig
- type Host
- type IPPool
- type Image
- type Instance
- type InstanceConfig
- type InstanceInfo
- type Network
- type NoCredentialsErr
- type NoLocalDigestErr
- type NoLocalImageAvailableErr
- type NoRemoteImageAvailableErr
- type ResourceResizer
- type Resources
- type State
- type VBoxErr
- type VMOpt
- type VboxLibrary
- type Vm
- func (vm *Vm) Close() error
- func (vm *Vm) Create(ctx context.Context) error
- func (v *Vm) Info() InstanceInfo
- func (v *Vm) LinkedClone(ctx context.Context, snapshot string, vmOpts ...VMOpt) (*Vm, error)
- func (vm *Vm) Run(ctx context.Context) error
- func (vm *Vm) Snapshot(name string) error
- func (vm *Vm) Start(ctx context.Context) error
- func (vm *Vm) Stop() error
- func (vm *Vm) Suspend(ctx context.Context) error
Constants ¶
View Source
const ( NoVPN = 0 OnlyVPN = 1 VPNBrowser = 2 )
View Source
const ( Running = State(0) Stopped = State(1) Suspended = State(2) Error = State(3) )
View Source
const (
NOAVAILABLEFRONTEND = "No available frontends found on your setup, please add at least one ova file !"
)
Variables ¶
View Source
var ( DefaultClient *docker.Client DefaultLinkBridge *defaultBridge TooLowMemErr = errors.New("memory needs to be atleast 50mb") InvalidHostBindingErr = errors.New("hostbing does not have correct format - (ip:)port") InvalidMountErr = errors.New("incorrect mount format - src:dest") NoRegistriesToPullFromErr = errors.New("no registries to pull from") NoImageErr = errors.New("unable to find image") EmptyDigestErr = errors.New("empty digest") DigestFormatErr = errors.New("unexpected digest format") NoRemoteDigestErr = errors.New("unable to get digest from remote image") NoAvailableIPsErr = errors.New("no available IPs") UnexpectedIPErr = errors.New("unexpected IP range") ContNotCreatedErr = errors.New("container is not created") Registries = map[string]docker.AuthConfiguration{ "": {}, } )
View Source
var FileTransferRoot string
Functions ¶
func CreateEventFolder ¶
func CreateFileTransferRoot ¶
func CreateUserFolder ¶
func GetAvailablePort ¶
func GetAvailablePort() uint
func GetContainerCount ¶
Gets the count of all containers running
func GetRunningVmCount ¶
Gets the count of running Virtual machines
func RemoveEventFolder ¶
Types ¶
type Container ¶
type Container struct { Id string Conf ContainerConfig Network *docker.Network Linked []*Container }
func NewContainer ¶
func NewContainer(conf ContainerConfig) *Container
func (*Container) Info ¶
func (c *Container) Info() InstanceInfo
type ContainerConfig ¶
type Image ¶
func (Image) NameWithReg ¶
type InstanceConfig ¶
type InstanceConfig struct { Image string `yaml:"image"` MemoryMB uint `yaml:"memoryMB"` CPU float64 `yaml:"cpu"` }
TODO comments and docs
type Network ¶
type Network struct { Net *docker.Network Subnet string IsVPN bool IpPool map[uint]struct{} Connected []*Container }
func NewNetwork ¶
type NoCredentialsErr ¶
type NoCredentialsErr struct {
Registry string
}
func (NoCredentialsErr) Error ¶
func (err NoCredentialsErr) Error() string
type NoLocalDigestErr ¶
type NoLocalDigestErr struct {
// contains filtered or unexported fields
}
func (NoLocalDigestErr) Error ¶
func (err NoLocalDigestErr) Error() string
type NoLocalImageAvailableErr ¶
type NoLocalImageAvailableErr struct {
// contains filtered or unexported fields
}
func (NoLocalImageAvailableErr) Error ¶
func (err NoLocalImageAvailableErr) Error() string
type NoRemoteImageAvailableErr ¶
type NoRemoteImageAvailableErr struct {
// contains filtered or unexported fields
}
func (NoRemoteImageAvailableErr) Error ¶
func (err NoRemoteImageAvailableErr) Error() string
type VMOpt ¶
func SetLocalRDP ¶
type VboxLibrary ¶
type VboxLibrary struct { M sync.Mutex Pwd string Known map[string]*Vm Locks map[string]*sync.Mutex }
func NewLibrary ¶
func NewLibrary(pwd string) *VboxLibrary
func (*VboxLibrary) GetCopy ¶
func (lib *VboxLibrary) GetCopy(ctx context.Context, conf InstanceConfig, vmOpts ...VMOpt) (*Vm, error)
func (*VboxLibrary) GetImagePath ¶
func (lib *VboxLibrary) GetImagePath(file string) string
func (*VboxLibrary) IsAvailable ¶
func (lib *VboxLibrary) IsAvailable(file string) bool
type Vm ¶
type Vm struct { Id string Path string Image string Running bool // contains filtered or unexported fields }
VM information is stored in a struct
func (*Vm) Info ¶
func (v *Vm) Info() InstanceInfo
func (*Vm) LinkedClone ¶
Click to show internal directories.
Click to hide internal directories.