Documentation ¶
Index ¶
- Variables
- type Store
- func (ts *Store) Check(id string) (string, error)
- func (ts *Store) GetID(key string) (string, error)
- func (ts *Store) GetIDs() ([]string, error)
- func (ts *Store) GetImageHash(id string) (string, error)
- func (ts *Store) GetPath(id string) string
- func (ts *Store) GetRootFS(id string) string
- func (ts *Store) Hash(id string) (string, error)
- func (ts *Store) IsRendered(id string) (bool, error)
- func (ts *Store) Remove(id string) error
- func (ts *Store) Render(key string, rebuild bool) (id string, hash string, err error)
- func (ts *Store) Size(id string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrReadHashfile when the hashfile cannot be read ErrReadHashfile = errors.New("cannot read hash file") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a store of rendered ACIs
func NewStore ¶
func NewStore(dir string, store *imagestore.Store) (*Store, error)
NewStore creates a Store for managing filesystem trees, including the dependency graph resolution of the underlying image layers.
func (*Store) GetID ¶
GetID calculates the treestore ID for the given image key. The treeStoreID is computed as an hash of the flattened dependency tree image keys. In this way the ID may change for the same key if the image's dependencies change.
func (*Store) GetIDs ¶
GetIDs returns a slice containing all the treeStore's IDs available (both fully or partially rendered).
func (*Store) GetImageHash ¶
GetImageHash returns the hash of the image that uses the tree store identified by id.
func (*Store) GetPath ¶
GetPath returns the absolute path of the treestore for the provided id. It doesn't ensure that the path exists and is fully rendered. This should be done calling IsRendered()
func (*Store) GetRootFS ¶
GetRootFS returns the absolute path of the rootfs for the provided id. It doesn't ensure that the rootfs exists and is fully rendered. This should be done calling IsRendered()
func (*Store) Hash ¶
Hash calculates an hash of the rendered ACI. It uses the same functions used to create a tar but instead of writing the full archive is just computes the sha512 sum of the file infos and contents.
func (*Store) IsRendered ¶
IsRendered checks if the tree store with the provided id is fully rendered
func (*Store) Render ¶
Render renders a treestore for the given image key if it's not already fully rendered. Users of treestore should call s.Render before using it to ensure that the treestore is completely rendered. Returns the id and hash of the rendered treestore if it is newly rendered, and only the id if it is already rendered.