api

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode added in v0.9.1

func Base64Decode(value string) ([]byte, error)

func Base64Encode added in v0.9.1

func Base64Encode(value string) string

func CleanPool

func CleanPool(name string) error

func DataStore2XML

func DataStore2XML(conf schema.DataStore) libvirts.Pool

func Disk2XML

func Disk2XML(conf *schema.Disk) (*libvirtc.DiskXML, error)

func GetArg

func GetArg(r *http.Request, name string) (string, bool)

func GetAuth

func GetAuth(req *http.Request) (name, pass string, ok bool)

func GetData

func GetData(r *http.Request, v interface{}) error

func GetFile

func GetFile(name string) string

func GetPath

func GetPath(store, name string) string

store: datastore@01 name: domain name

func GetQueryOne

func GetQueryOne(req *http.Request, name string) string

func GetStatic

func GetStatic() string

func GetTypeByVolume

func GetTypeByVolume(file string) (string, string)

func GetUser

func GetUser(req *http.Request) (schema.User, bool)

func Instance2XML

func Instance2XML(conf *schema.Instance) (libvirtc.DomainXML, error)

func Interface2XML

func Interface2XML(source, model, seq, typ, drv, que string) *libvirtc.InterfaceXML

func IsUniCast

func IsUniCast(address string) bool

func IsVolume

func IsVolume(file string) bool

func Network2XML

func Network2XML(conf schema.Network) *libvirtn.NetworkXML

func NewBackingVolumeAndPool

func NewBackingVolumeAndPool(store, name, disk, backingFle, backingFmt string) (*libvirts.VolumeXML, error)

name: Domain name. store: like: datatore@01

func NewCdXML

func NewCdXML(file, family string, seq *diskSeq) libvirtc.DiskXML

func NewDiskXML

func NewDiskXML(format, file, bus string, seq *diskSeq) libvirtc.DiskXML

func NewFileXML

func NewFileXML(disk *schema.Disk, conf *schema.Instance, seq *diskSeq) (libvirtc.DiskXML, error)

func NewIsoXML

func NewIsoXML(file, family string, seq *diskSeq) libvirtc.DiskXML

func NewVolume

func NewVolume(name, disk string, size uint64) (*libvirts.VolumeXML, error)

name: domain name disk: disk name size: disk size using bytes

func NewVolumeAndPool

func NewVolumeAndPool(store, name, disk string, size uint64) (*libvirts.VolumeXML, error)

name: Domain name. store: like: datatore@01

func ParseBasicAuth

func ParseBasicAuth(auth string) (username, password string, ok bool)

func ParseFiles

func ParseFiles(w http.ResponseWriter, name string, data interface{}) error

func RemovePool

func RemovePool(name string) error

name: Domain name.

func ResponseJson

func ResponseJson(w http.ResponseWriter, v interface{})

func ResponseMsg

func ResponseMsg(w http.ResponseWriter, code int, message string)

func ResponseXML

func ResponseXML(w http.ResponseWriter, v string)

func SetStatic

func SetStatic(dir string)

func UpdateCookie

func UpdateCookie(w http.ResponseWriter, req *http.Request, user schema.User)

Types

type Api

type Api interface {
	Router(router *mux.Router)
	Get(w http.ResponseWriter, r *http.Request)
	Post(w http.ResponseWriter, r *http.Request)
	Delete(w http.ResponseWriter, r *http.Request)
	Put(w http.ResponseWriter, r *http.Request)
}

type Bridger

type Bridger struct {
}

func (Bridger) Delete

func (br Bridger) Delete(w http.ResponseWriter, r *http.Request)

func (Bridger) Get

func (br Bridger) Get(w http.ResponseWriter, r *http.Request)

func (Bridger) Post

func (br Bridger) Post(w http.ResponseWriter, r *http.Request)

func (Bridger) Put

func (br Bridger) Put(w http.ResponseWriter, r *http.Request)

func (Bridger) Router

func (br Bridger) Router(router *mux.Router)

type DHCPLease

type DHCPLease struct {
}

func (DHCPLease) Get

func (l DHCPLease) Get(w http.ResponseWriter, r *http.Request)

func (DHCPLease) Getx

func (l DHCPLease) Getx(data schema.DHCPLeases) error

func (DHCPLease) Router

func (l DHCPLease) Router(router *mux.Router)

type DataStore

type DataStore struct {
}

func (DataStore) Delete

func (store DataStore) Delete(w http.ResponseWriter, r *http.Request)

func (DataStore) Get

func (store DataStore) Get(w http.ResponseWriter, r *http.Request)

func (DataStore) Post

func (store DataStore) Post(w http.ResponseWriter, r *http.Request)

func (DataStore) Put

func (store DataStore) Put(w http.ResponseWriter, r *http.Request)

func (DataStore) Router

func (store DataStore) Router(router *mux.Router)

type Disk

type Disk struct {
}

func (Disk) Delete

func (disk Disk) Delete(w http.ResponseWriter, r *http.Request)

func (Disk) FindByDev

func (disk Disk) FindByDev(devices *libvirtc.DevicesXML, dev string) *libvirtc.DiskXML

func (Disk) Get

func (disk Disk) Get(w http.ResponseWriter, r *http.Request)

func (Disk) Post

func (disk Disk) Post(w http.ResponseWriter, r *http.Request)

func (Disk) Router

func (disk Disk) Router(router *mux.Router)

func (Disk) Travel

func (disk Disk) Travel(instance schema.Instance) map[string]libvirts.VolumeInfo

type Graphics

type Graphics struct {
}

func (Graphics) Get

func (gra Graphics) Get(w http.ResponseWriter, r *http.Request)

func (Graphics) Post

func (gra Graphics) Post(w http.ResponseWriter, r *http.Request)

func (Graphics) Router

func (gra Graphics) Router(router *mux.Router)

type History added in v0.9.1

type History struct {
}

func (History) Get added in v0.9.1

func (his History) Get(w http.ResponseWriter, r *http.Request)

func (History) Router added in v0.9.1

func (his History) Router(router *mux.Router)

type Hyper

type Hyper struct {
}

func (Hyper) Get

func (h Hyper) Get(w http.ResponseWriter, r *http.Request)

func (Hyper) Router

func (h Hyper) Router(router *mux.Router)

func (Hyper) Statics

func (h Hyper) Statics(w http.ResponseWriter, r *http.Request)

type ISO

type ISO struct {
}

func (ISO) Get

func (iso ISO) Get(w http.ResponseWriter, r *http.Request)

func (ISO) Router

func (iso ISO) Router(router *mux.Router)

type Instance

type Instance struct {
}

func (Instance) Delete

func (ins Instance) Delete(w http.ResponseWriter, r *http.Request)

func (Instance) Destroy

func (ins Instance) Destroy(w http.ResponseWriter, r *http.Request)

func (Instance) Execute

func (ins Instance) Execute(w http.ResponseWriter, uuid, action string)

func (Instance) Get

func (ins Instance) Get(w http.ResponseWriter, r *http.Request)

func (Instance) GetByUser

func (ins Instance) GetByUser(user *schema.User, list *schema.ListInstance)

func (Instance) HasPermission

func (ins Instance) HasPermission(user *schema.User, instance string) bool

func (Instance) Post

func (ins Instance) Post(w http.ResponseWriter, r *http.Request)

func (Instance) Reset

func (ins Instance) Reset(w http.ResponseWriter, r *http.Request)

func (Instance) Resume

func (ins Instance) Resume(w http.ResponseWriter, r *http.Request)

func (Instance) Router

func (ins Instance) Router(router *mux.Router)

func (Instance) Shutdown

func (ins Instance) Shutdown(w http.ResponseWriter, r *http.Request)

func (Instance) Start

func (ins Instance) Start(w http.ResponseWriter, r *http.Request)

func (Instance) Stats

func (ins Instance) Stats(w http.ResponseWriter, r *http.Request)

func (Instance) Suspend

func (ins Instance) Suspend(w http.ResponseWriter, r *http.Request)

func (Instance) Title

func (ins Instance) Title(w http.ResponseWriter, r *http.Request)

func (Instance) Undefine

func (ins Instance) Undefine(w http.ResponseWriter, r *http.Request)

type Interface

type Interface struct {
}

func (Interface) Delete

func (in Interface) Delete(w http.ResponseWriter, r *http.Request)

func (Interface) Get

func (in Interface) Get(w http.ResponseWriter, r *http.Request)

func (Interface) List

func (in Interface) List(w http.ResponseWriter, r *http.Request)

func (Interface) Post

func (in Interface) Post(w http.ResponseWriter, r *http.Request)

func (Interface) Put

func (in Interface) Put(w http.ResponseWriter, r *http.Request)

func (Interface) Router

func (in Interface) Router(router *mux.Router)

type Memory

type Memory struct {
}

func (Memory) Delete

func (mem Memory) Delete(w http.ResponseWriter, r *http.Request)

func (Memory) Get

func (mem Memory) Get(w http.ResponseWriter, r *http.Request)

func (Memory) Post

func (mem Memory) Post(w http.ResponseWriter, r *http.Request)

func (Memory) Put

func (mem Memory) Put(w http.ResponseWriter, r *http.Request)

func (Memory) Router

func (mem Memory) Router(router *mux.Router)

type Network

type Network struct {
}

func (Network) Delete

func (net Network) Delete(w http.ResponseWriter, r *http.Request)

func (Network) Get

func (net Network) Get(w http.ResponseWriter, r *http.Request)

func (Network) Post

func (net Network) Post(w http.ResponseWriter, r *http.Request)

func (Network) Put

func (net Network) Put(w http.ResponseWriter, r *http.Request)

func (Network) Router

func (net Network) Router(router *mux.Router)

type Password

type Password struct {
	Old string `json:"old"`
	New string `json:"new"`
}

type Processor

type Processor struct {
}

func (Processor) Delete

func (proc Processor) Delete(w http.ResponseWriter, r *http.Request)

func (Processor) Get

func (proc Processor) Get(w http.ResponseWriter, r *http.Request)

func (Processor) Post

func (proc Processor) Post(w http.ResponseWriter, r *http.Request)

func (Processor) Put

func (proc Processor) Put(w http.ResponseWriter, r *http.Request)

func (Processor) Router

func (proc Processor) Router(router *mux.Router)

type ProxyTcp

type ProxyTcp struct {
}

func (ProxyTcp) Get

func (pro ProxyTcp) Get(w http.ResponseWriter, r *http.Request)

func (ProxyTcp) GetTarget

func (pro ProxyTcp) GetTarget(host string, inst *schema.Instance, leases schema.DHCPLeases) []schema.Target

func (ProxyTcp) Graphics

func (pro ProxyTcp) Graphics(inst *schema.Instance) []schema.Target

func (ProxyTcp) Local

func (pro ProxyTcp) Local(user *schema.User) []schema.Target

func (ProxyTcp) Remote

func (pro ProxyTcp) Remote(user *schema.User) []schema.Target

func (ProxyTcp) Router

func (pro ProxyTcp) Router(router *mux.Router)

type Snapshot

type Snapshot struct {
}

func (Snapshot) Delete

func (in Snapshot) Delete(w http.ResponseWriter, r *http.Request)

func (Snapshot) Get

func (in Snapshot) Get(w http.ResponseWriter, r *http.Request)

func (Snapshot) Post

func (in Snapshot) Post(w http.ResponseWriter, r *http.Request)

func (Snapshot) Revert

func (in Snapshot) Revert(w http.ResponseWriter, r *http.Request)

func (Snapshot) Router

func (in Snapshot) Router(router *mux.Router)

type Upload

type Upload struct {
}

func (Upload) Get

func (up Upload) Get(w http.ResponseWriter, r *http.Request)

func (Upload) Post

func (up Upload) Post(w http.ResponseWriter, r *http.Request)

func (Upload) Router

func (up Upload) Router(router *mux.Router)

type User

type User struct {
}

func (User) Delete

func (u User) Delete(writer http.ResponseWriter, request *http.Request)

func (User) Get

func (u User) Get(writer http.ResponseWriter, request *http.Request)

func (User) Post

func (u User) Post(writer http.ResponseWriter, request *http.Request)

func (User) Put

func (u User) Put(writer http.ResponseWriter, request *http.Request)

func (User) Router

func (u User) Router(router *mux.Router)

type Volume

type Volume struct {
}

func (Volume) Delete

func (v Volume) Delete(w http.ResponseWriter, r *http.Request)

func (Volume) Get

func (v Volume) Get(w http.ResponseWriter, r *http.Request)

func (Volume) Post

func (v Volume) Post(w http.ResponseWriter, r *http.Request)

func (Volume) Put

func (v Volume) Put(w http.ResponseWriter, r *http.Request)

func (Volume) Router

func (v Volume) Router(router *mux.Router)

type Zone

type Zone struct {
}

func (Zone) Delete

func (z Zone) Delete(w http.ResponseWriter, r *http.Request)

func (Zone) Get

func (z Zone) Get(w http.ResponseWriter, r *http.Request)

func (Zone) Post

func (z Zone) Post(w http.ResponseWriter, r *http.Request)

func (Zone) Put

func (z Zone) Put(w http.ResponseWriter, r *http.Request)

func (Zone) Router

func (z Zone) Router(router *mux.Router)

Jump to

Keyboard shortcuts

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