metadata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ObjectTypeLookup = map[ObjectType]string{
	Image:  "image",
	Kernel: "kernel",
	VM:     "VM",
}

Functions

This section is empty.

Types

type IDNameFilter

type IDNameFilter struct {
	// contains filtered or unexported fields
}

func NewIDNameFilter

func NewIDNameFilter(p string) *IDNameFilter

func (*IDNameFilter) Filter

func (n *IDNameFilter) Filter(f filter.Filterable) ([]string, error)

type Metadata

type Metadata struct {
	ID         string      `json:"ID"`
	Name       string      `json:"Name"`
	Type       ObjectType  `json:"Type"`
	Created    metav1.Time `json:"Created"`
	ObjectData `json:"ObjectData"`
}

func NewMetadata

func NewMetadata(id, name string, t ObjectType, data ObjectData) *Metadata

func (*Metadata) Load

func (md *Metadata) Load() error

func (*Metadata) ObjectPath

func (md *Metadata) ObjectPath() string

func (*Metadata) Save

func (md *Metadata) Save() error

type ObjectData

type ObjectData interface{}

type ObjectType

type ObjectType int
const (
	Image ObjectType = iota + 1 // Reserve 0 for unset
	Kernel
	VM
)

func (ObjectType) MarshalJSON

func (x ObjectType) MarshalJSON() ([]byte, error)

func (ObjectType) Path

func (x ObjectType) Path() string

func (ObjectType) String

func (x ObjectType) String() string

func (*ObjectType) UnmarshalJSON

func (x *ObjectType) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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