Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ASC means ascending order for the query result. ASC = "asc" // DESC means descending order for the query result. DESC = "desc" // OrderByTime indicates sortby creation time. OrderByTime = "creation_time" // OrderBySize indicates sortby size. OrderBySize = "size" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID string
ID ...
func ConvertIDs ¶
ConvertIDs convert a slice of uuid into a slice of ID.
func NewRandomID ¶
func NewRandomID() ID
NewRandomID generates a new unused snapshot identifier at random.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON is a json helper.
type Query ¶
type Query struct { // TODO: Combine ID and IDs into one? Any UI impact? // Query by ID ID ID `json:"id"` IDs []ID `json:"ids"` // Pagination Offset int `json:"offset"` Limit int `json:"limit"` SortBy string `json:"sortby"` OrderType string `json:"order"` // Group 1 attributes. Name string `json:"name"` Prefix string `json:"prefix"` Creator string `json:"creator"` CreatorUsername string `json:"creator_username"` Owner string `json:"owner"` OwnerUsername string `json:"owner_username"` // For now, the query will try to match entries that matches // all attributes present in here. Attr attrs.Attrs `json:"attr"` Search string `json:"search"` // Short UUID specifies the short UUID to match with ID. ShortUUID string // RegExName specifies the regulr expression used to match prefix + name RegExName string }
Query ..
type VolumeSet ¶
type VolumeSet struct { ID ID `json:"id"` Attrs attrs.Attrs `json:"attrs"` CreationTime time.Time `json:"creation_time"` Size uint64 `json:"size"` Creator string `json:"creator"` CreatorUsername string `json:"creator_username"` Owner string `json:"owner"` OwnerUsername string `json:"owner_username"` Name string `json:"name"` Prefix string `json:"prefix"` LastModifiedTime time.Time `json:"last_modified_time"` // last time the meta data is modified LastSnapshotTime time.Time `json:"last_snapshot_time"` // last time a snapshot is taken on this volume NumSnapshots int `json:"num_snapshots"` NumBranches int `json:"num_branches"` Description string `json:"description"` }
VolumeSet ...
func (*VolumeSet) RetrieveKnownKeys ¶
func (vs *VolumeSet) RetrieveKnownKeys()
RetrieveKnownKeys retrives all known keys from attributes
func (*VolumeSet) SetCreatorUUID ¶
SetCreatorUUID sets creator uuid given the current user
func (*VolumeSet) SetOwnerUUID ¶
SetOwnerUUID sets owner uuid from name and current client and creator
func (*VolumeSet) StoreKnownKeys ¶
func (vs *VolumeSet) StoreKnownKeys()
StoreKnownKeys stores all known keys to attributes
Click to show internal directories.
Click to hide internal directories.