Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByIncreasingAge ¶
type ByIncreasingAge []*kepEntry
func (ByIncreasingAge) Len ¶
func (a ByIncreasingAge) Len() int
func (ByIncreasingAge) Less ¶
func (a ByIncreasingAge) Less(i, j int) bool
func (ByIncreasingAge) Swap ¶
func (a ByIncreasingAge) Swap(i, j int)
type Index ¶
type Index interface { ClaimNextShortID() int // implementations of Index MUST tolerate HasShortID being called from within Update() to prevent deadlocks HasShortID(int) bool // implementations of Index MUST tolerate HasShortID being called from within Update() to prevent deadlocks Fetch(string) (keps.Instance, error) // TODO add Filter(metadata.KEP) metadata.KEP // TODO add Remove(keps.Instance) Update(keps.Instance) error Persist() error }
func Open ¶
Open returns an existing Index persisted at contentRoot. The index will not be rebuilt so callers should not add a *new* KEP to the index. Open will fail if any persisted KEP entry cannot be loaded. Open is intended to be used in the context of operations on a *single* KEP
func Rebuild ¶
Rebuild
- walks directories starting at runtime.ContentRoot() looking for KEP metadata.yaml files in the tree. For each metadata.yaml that is found
- open KEP
- add global index consistency checks to KEP
- add KEP to index
- keeps track of the highest short KEP ID encountered for possible future allocation
Click to show internal directories.
Click to hide internal directories.