Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// Get retrieves the executable path for a cached provider.
// Returns empty string and nil error if the provider is not cached.
Get(ctx context.Context, id ProviderIdentifier) (executablePath string, err error)
// Put stores a provider archive and returns the path to the extracted executable.
// archivePath is the path to the downloaded zip file.
Put(ctx context.Context, id ProviderIdentifier, archivePath string) (executablePath string, err error)
// Has checks if a provider is cached.
Has(ctx context.Context, id ProviderIdentifier) (bool, error)
}
Cache defines the interface for provider binary caching.
type FilesystemCache ¶
type FilesystemCache struct {
// contains filtered or unexported fields
}
FilesystemCache implements Cache using the local filesystem.
func NewFilesystemCache ¶
func NewFilesystemCache(baseDir string) *FilesystemCache
NewFilesystemCache creates a new filesystem-based cache at the given directory.
func (*FilesystemCache) Get ¶
func (c *FilesystemCache) Get(ctx context.Context, id ProviderIdentifier) (string, error)
Get retrieves the executable path for a cached provider.
func (*FilesystemCache) Has ¶
func (c *FilesystemCache) Has(ctx context.Context, id ProviderIdentifier) (bool, error)
Has checks if a provider is cached.
func (*FilesystemCache) Put ¶
func (c *FilesystemCache) Put(ctx context.Context, id ProviderIdentifier, archivePath string) (string, error)
Put stores a provider archive and returns the path to the extracted executable.
Click to show internal directories.
Click to hide internal directories.