driver

package
v0.0.0-...-19b7e1b Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const HOST = 1
View Source
const METHOD = 0

Variables

View Source
var Connection []string
View Source
var Location string

Functions

func Copy_base

func Copy_base(base string, user uint, name string)

func Create_config

func Create_config(vmname string, c *model.ConfigInput) (*string, error)

func Initfs

func Initfs(l string, auth_host []string)

func Usb_info

func Usb_info() [][]string

func Vmfile

func Vmfile(user uint, name string) string

Types

type Libvirt

type Libvirt struct {
	// contains filtered or unexported fields
}

func New_kvm

func New_kvm(c string) *Libvirt

func (*Libvirt) AttachDevice

func (l *Libvirt) AttachDevice(vm model.Vm, hdev model.Hostdev) error

func (*Libvirt) Close

func (l *Libvirt) Close()

func (*Libvirt) Create

func (l *Libvirt) Create(vm model.Vm, uid uint, config_path *string)

func (*Libvirt) Destroy

func (l *Libvirt) Destroy(query string) error

func (*Libvirt) DetachDevice

func (l *Libvirt) DetachDevice(vm model.Vm, hdev model.Hostdev) error

func (*Libvirt) ForceOFF

func (l *Libvirt) ForceOFF(query string) error

func (*Libvirt) Init

func (l *Libvirt) Init()

func (*Libvirt) List

func (l *Libvirt) List()

func (*Libvirt) Listt

func (l *Libvirt) Listt()

1 : CONNECT_LIST_DOMAINS_ACTIVE 2 : CONNECT_LIST_DOMAINS_INACTIVE 4 : CONNECT_LIST_DOMAINS_PERSISTENT 16: CONNECT_LIST_DOMAINS_RUNNING 32: CONNECT_LIST_DOMAINS_PAUSED 64: CONNECT_LIST_DOMAINS_SHUTOFF

func (*Libvirt) PowerOn

func (l *Libvirt) PowerOn(query string) error

func (*Libvirt) Shutdown

func (l *Libvirt) Shutdown(query string) error

type Metadata

type Metadata struct {
	Id     string `yaml:"instance-id"`
	Dsmode string
}

---------------------------- meta-data ----------------------------

type Nconfig

type Nconfig struct {
	Type    string
	Name    string
	Subnets []Subnet
}

type Net

type Net struct {
	Network struct {
		Version int
		Config  []Nconfig
	}
}

---------------------------- network-config ----------------------------

type Provider

type Provider interface {
	Init()
	Create(vm model.Vm, uid uint, config_path *string)
	AttachDevice(vm model.Vm, dev model.Hostdev) error
	DetachDevice(vm model.Vm, dev model.Hostdev) error
	List()
	Listt()
	Shutdown(query string) error
	Destroy(query string) error
	ForceOFF(query string) error
	PowerOn(query string) error
	Close()
}

func New

func New(d string, uri string) Provider

type Subnet

type Subnet struct {
	Type            string
	Address         string   `yaml:",omitempty"`
	Netmask         string   `yaml:",omitempty"`
	Gateway         string   `yaml:",omitempty"`
	Dns_nameservers []string `yaml:",omitempty"`
}

type Uconfig

type Uconfig struct {
	Name        string
	Groups      string
	Lock_passwd bool
	Passwd      string `yaml:",omitempty"`
	Shell       string
	Sudo        []string
	Keys        []string `yaml:"ssh-authorized-keys,omitempty"`
}

type Udata

type Udata struct {
	Package_upgrade bool
	Users           []Uconfig
}

Jump to

Keyboard shortcuts

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