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 AmbiguousError ¶ added in v0.3.0
type AmbiguousError struct {
// contains filtered or unexported fields
}
type AnyMetadata ¶
type AnyMetadata interface {
GetMD() *Metadata
}
This interface enables taking in any struct which embeds Metadata
func LoadAllMetadata ¶
func LoadAllMetadata(path string, loadFunc func(*ID) (AnyMetadata, error)) ([]AnyMetadata, error)
type Filter ¶
type Filter interface {
Filter(AnyMetadata) []string
ErrNonexistent() error
ErrAmbiguous([]*Match) error
}
type ID ¶ added in v0.3.0
type ID struct {
// contains filtered or unexported fields
}
func (*ID) MarshalJSON ¶ added in v0.3.0
func (*ID) UnmarshalJSON ¶ added in v0.3.0
type IDNameFilter ¶
type IDNameFilter struct {
// contains filtered or unexported fields
}
func NewIDNameFilter ¶
func NewIDNameFilter(p string, t ObjectType) *IDNameFilter
func (*IDNameFilter) ErrAmbiguous ¶
func (f *IDNameFilter) ErrAmbiguous(matches []*Match) error
func (*IDNameFilter) ErrNonexistent ¶
func (f *IDNameFilter) ErrNonexistent() error
func (*IDNameFilter) Filter ¶
func (f *IDNameFilter) Filter(any AnyMetadata) []string
type Match ¶
type Match struct {
Object AnyMetadata
Strings []string
}
type Metadata ¶
type Metadata struct {
ID *ID `json:"ID"`
Name Name `json:"Name"`
Type ObjectType `json:"Type"`
Created metav1.Time `json:"Created"`
ObjectData `json:"ObjectData"`
}
func NewMetadata ¶
func NewMetadata(id *ID, name *Name, t ObjectType, data ObjectData) (*Metadata, error)
func (*Metadata) Cleanup ¶ added in v0.3.0
silent specifies if the ID should be printed, when chaining commands silence all but the last command to print the ID only once
func (*Metadata) ObjectPath ¶
type Name ¶
type Name struct {
// contains filtered or unexported fields
}
func NewNameWithLatest ¶ added in v0.3.0
func NewNameWithLatest(input string, matches *[]AnyMetadata) (*Name, error)
func (Name) MarshalJSON ¶
func (*Name) UnmarshalJSON ¶
type NonexistentError ¶ added in v0.3.0
type NonexistentError struct {
// contains filtered or unexported fields
}
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
Click to show internal directories.
Click to hide internal directories.