Documentation
¶
Overview ¶
Package cache facilitates caching git and git-lfs objects.
Index ¶
- type Cache
- type Link
- func (c *Link) UpdateFromGit(ctx context.Context, gitRemote string, argRevList ...string) error
- func (c *Link) UpdateFromOCI(ctx context.Context, src content.ReadOnlyGraphStorage, ...) error
- func (c *Link) UpdateLFSFromGit(ctx context.Context, gitRemote string, commits ...string) error
- func (c *Link) UpdateLFSFromOCI(ctx context.Context, src content.ReadOnlyGraphStorage, ...) ([]ocispec.Descriptor, error)
- type ObjectCacher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache represents a cache of git and git-lfs objects.
func NewCache ¶
func NewCache(ctx context.Context, cachePath, fstorePath string, fstore *file.Store, cmdOpts *cmd.Options) (*Cache, error)
NewCache is a constructor for a Cache, expects cachePath to exist. The cmdOpts are only used for initialization. TODO: Should we have a default cache path? If so, this should be added to the flag not here.
type Link ¶
Link provides concurrency safe access to a git object cache. Link implements ObjectCacher.
func (*Link) UpdateFromGit ¶
UpdateFromGit updates the cache with objects from a remote git repository that are reachable from argRevList, or all objects if argRevList is empty.
func (*Link) UpdateFromOCI ¶
func (c *Link) UpdateFromOCI(ctx context.Context, src content.ReadOnlyGraphStorage, manDesc ocispec.Descriptor) error
UpdateFromOCI updates the cache with the specified contents from an OCI repository.
func (*Link) UpdateLFSFromGit ¶
UpdateLFSFromGit updates the cache with LFS objects from a remote git repository that are reachable from argRevList, or all objects if argRevList is empty.
func (*Link) UpdateLFSFromOCI ¶
func (c *Link) UpdateLFSFromOCI(ctx context.Context, src content.ReadOnlyGraphStorage, lfsManDesc ocispec.Descriptor) ([]ocispec.Descriptor, error)
UpdateLFSFromOCI updates the cache with LFS objects from a remote git repository stored in OCI format that are reachable from argRevList, or all objects if argRevList is empty. Returns a list of fetched LFS OIDs.
type ObjectCacher ¶
type ObjectCacher interface { CachePath() string UpdateFromGit(ctx context.Context, gitRemote string, argRevList ...string) error UpdateFromOCI(ctx context.Context, src content.ReadOnlyGraphStorage, manDesc ocispec.Descriptor) error UpdateLFSFromGit(ctx context.Context, gitRemote string, argRevList ...string) error UpdateLFSFromOCI(ctx context.Context, src content.ReadOnlyGraphStorage, lfsManDesc ocispec.Descriptor) ([]ocispec.Descriptor, error) }
ObjectCacher proivdes methods for adding git or git-lfs objects to a cache.