Documentation ¶
Index ¶
- Constants
- Variables
- func MatchManifest(filters []Filter, m *Manifest) bool
- type FileMetadata
- type Filter
- func GetFilter(name, value string) (Filter, bool)
- func NameFilter(name string) Filter
- func OsFilter(os string) Filter
- func OwnerFilter(owner string) Filter
- func PublicFilter(str string) Filter
- func StateFilter(str string) Filter
- func TypeFilter(t string) Filter
- func VersionFilter(version string) Filter
- type ImageFile
- type Manifest
- type ManifestState
- type Pool
- func (self *Pool) Activate(uuid string) (*Manifest, errors.Error)
- func (self *Pool) AddFile(uuid, compression string, reader io.Reader) (*Manifest, errors.Error)
- func (self *Pool) Create(m *Manifest) errors.Error
- func (self *Pool) Delete(uuid string) errors.Error
- func (self *Pool) Get(uuid string) (*Manifest, errors.Error)
- func (self *Pool) GetFile(uuid string) (io.ReadCloser, *FileMetadata, errors.Error)
- func (self *Pool) List(filters []Filter) []*Manifest
- func (self *Pool) SetDisabled(uuid string, disabled bool) (*Manifest, errors.Error)
Constants ¶
View Source
const (
ManifestVersion = 2
)
View Source
const (
ManifestsFname = "manifests.json"
)
Variables ¶
View Source
var FileExtensions = map[string]string{
"bzip2": "bz2",
"gzip": "gz",
"none": "raw",
}
Functions ¶
func MatchManifest ¶
Types ¶
type FileMetadata ¶
type Filter ¶
func NameFilter ¶
func OwnerFilter ¶
func PublicFilter ¶
func StateFilter ¶
func TypeFilter ¶
func VersionFilter ¶
type Manifest ¶
type Manifest struct { // Required V int `json:"v"` Uuid string `json:"uuid"` Owner string `json:"owner"` Name string `json:"name"` Version string `json:"version"` State ManifestState `json:"state"` Disabled bool `json:"disabled"` Public bool `json:"public"` PublishedAt string `json:"published_at"` Type string `json:"type"` Os string `json:"os"` Files []*ImageFile `json:"files"` // Required if type == zvol NicDriver string `json:"nic_driver"` DiskDriver string `json:"disk_driver"` CpuType string `json:"cpu_type"` ImageSize int64 `json:"image_size"` // Optional Description string `json:"description"` }
type ManifestState ¶
type ManifestState string
const ( StateActive ManifestState = "active" StateUnactivated ManifestState = "unactivated" StateDisabled ManifestState = "disabled" )
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewImagePool ¶
func (*Pool) GetFile ¶
func (self *Pool) GetFile(uuid string) (io.ReadCloser, *FileMetadata, errors.Error)
Click to show internal directories.
Click to hide internal directories.