storage

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DataStore = "datastore@"
View Source
const Location = "/lightstar/"

Variables

View Source
var DATASTOR = StoreMgr{
	Store: make([]Store, 0, 32),
}
View Source
var ISO = IsoMgr{
	Files: make([]IsoFile, 0, 32),
}
View Source
var PATH = StorePath{}

Functions

func IsStoreID

func IsStoreID(name string) bool

func NewDataStore

func NewDataStore(pol libvirts.Pool) schema.DataStore

Types

type IsoFile

type IsoFile struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type IsoMgr

type IsoMgr struct {
	Files []IsoFile `json:"files"`
}

func (*IsoMgr) ListFiles

func (iso *IsoMgr) ListFiles(dir string) []IsoFile

type Store

type Store struct {
	Name       string `json:"name"`
	Path       string `json:"path"`
	State      int    `json:"state"`
	Capacity   uint64 `json:"capacity"`
	Allocation uint64 `json:"allocation"`
	Available  uint64 `json:"available"`
}

type StoreMgr

type StoreMgr struct {
	Store []Store `json:"storage"`
}

func (*StoreMgr) Init

func (store *StoreMgr) Init()

func (*StoreMgr) List

func (store *StoreMgr) List() []Store

type StorePath

type StorePath struct{}

func (StorePath) Fmt

func (p StorePath) Fmt(path string) string

path: unix path, /lightstar/datastore/01/xx.xx

func (StorePath) GetStoreID

func (p StorePath) GetStoreID(name string) string

name: datastore@01

func (StorePath) IsDataStore

func (p StorePath) IsDataStore(name string) bool

name: datastore@01

func (StorePath) Root

func (p StorePath) Root() string

func (StorePath) RootXML

func (p StorePath) RootXML() string

func (StorePath) Unix

func (p StorePath) Unix(path string) string

path: datastore@01:/centos.77 or 01.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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