api

package
v0.5.90 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ROUTER = &RouteMatcher{
	Match: make([]RouteMatch, 0, 32),
}

Functions

func DataStore2XML added in v0.4.83

func DataStore2XML(conf schema.DataStore) libvirts.Pool

func DelVolumeAndPool

func DelVolumeAndPool(name string) error

name: Domain name.

func Disk2XML added in v0.4.83

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

func GetArg

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

func GetAuth added in v0.5.90

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 GetUser added in v0.5.90

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

func HasPermission added in v0.5.90

func HasPermission(req *http.Request) bool

func Instance2XML added in v0.4.83

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

func Interface2XML added in v0.4.83

func Interface2XML(conf *schema.Interface) (*libvirtc.InterfaceXML, error)

func IsUnicast added in v0.4.83

func IsUnicast(address string) bool

func IsVolume

func IsVolume(file string) bool

func Network2XML added in v0.4.83

func Network2XML(conf schema.Network) libvirtn.NetworkXML

func NewCDROMXML

func NewCDROMXML(file, family string) libvirtc.DiskXML

func NewDiskXML

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

func NewISOXML

func NewISOXML(file, family string) 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 added in v0.5.90

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

func ParseFiles

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

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 Slot2Disk

func Slot2Disk(slot uint8) 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 added in v0.4.83

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 added in v0.4.83

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

func (Bridger) PUT added in v0.4.83

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

func (Bridger) Router

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

type DataStore

type DataStore struct {
}

func (DataStore) DELETE added in v0.4.83

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 added in v0.4.83

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

func (DataStore) PUT added in v0.4.83

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) GET added in v0.4.83

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 added in v0.4.83

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

func (Disk) Router

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

type Graphics added in v0.5.90

type Graphics struct {
}

func (Graphics) DELETE added in v0.5.90

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

func (Graphics) GET added in v0.5.90

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

func (Graphics) POST added in v0.5.90

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

func (Graphics) PUT added in v0.5.90

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

func (Graphics) Router added in v0.5.90

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

type Hyper added in v0.4.83

type Hyper struct {
}

func (Hyper) GET added in v0.4.83

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

func (Hyper) Router added in v0.4.83

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

type ISO

type ISO struct {
}

func (ISO) DELETE added in v0.4.83

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 added in v0.4.83

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

func (ISO) PUT added in v0.4.83

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) 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 added in v0.4.83

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 added in v0.4.83

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

func (Interface) Router

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

type Memory added in v0.5.90

type Memory struct {
}

func (Memory) DELETE added in v0.5.90

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

func (Memory) GET added in v0.5.90

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

func (Memory) POST added in v0.5.90

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

func (Memory) PUT added in v0.5.90

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

func (Memory) Router added in v0.5.90

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

type Network added in v0.4.83

type Network struct {
}

func (Network) DELETE added in v0.4.83

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

func (Network) GET added in v0.4.83

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

func (Network) POST added in v0.4.83

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

func (Network) PUT added in v0.4.83

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

func (Network) Router added in v0.4.83

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

type Processor added in v0.5.90

type Processor struct {
}

func (Processor) DELETE added in v0.5.90

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

func (Processor) GET added in v0.5.90

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

func (Processor) POST added in v0.5.90

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

func (Processor) PUT added in v0.5.90

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

func (Processor) Router added in v0.5.90

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

type RouteItem added in v0.5.90

type RouteItem struct {
	Value string
	Type  string // argument or path
}

type RouteMatch added in v0.5.90

type RouteMatch struct {
	Path   string
	Values []RouteItem
	Type   string // prefix or path
	Method string
	Action string // permit or deny
}

type RouteMatcher added in v0.5.90

type RouteMatcher struct {
	Match []RouteMatch
}

func (*RouteMatcher) Add added in v0.5.90

func (r *RouteMatcher) Add(m RouteMatch)

type Upload added in v0.4.83

type Upload struct {
}

func (Upload) Router added in v0.4.83

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

func (Upload) Upload added in v0.4.83

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

Jump to

Keyboard shortcuts

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