api

package
v0.8.35 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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)

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) DELETE

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

func (DHCPLease) GET

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

func (DHCPLease) Get

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

func (DHCPLease) POST

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

func (DHCPLease) PUT

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

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) PUT

func (disk Disk) PUT(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) DELETE

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

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) PUT

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

func (Graphics) Router

func (gra Graphics) 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)

type ISO

type ISO struct {
}

func (ISO) DELETE

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

func (ISO) GET

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

func (ISO) POST

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

func (ISO) PUT

func (iso ISO) PUT(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) 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) PUT

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

func (Instance) Router

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

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) 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) DELETE

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

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) POST

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

func (ProxyTcp) PUT

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

func (ProxyTcp) Remote

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

func (ProxyTcp) Router

func (pro ProxyTcp) 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