cache

package
v0.0.0-...-71fa1fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 7 Imported by: 0

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

Get retrieves the executable path for a cached provider.

func (*FilesystemCache) Has

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.

type ProviderIdentifier

type ProviderIdentifier struct {
	Namespace string
	Name      string
	Version   string
	OS        string
	Arch      string
}

ProviderIdentifier uniquely identifies a provider binary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL