cache

package
v3.111.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Restore

func Restore(ctx context.Context, l logger.Logger, cfg Config) error

Restore restores caches based on the provided configuration and logs results as each cache is processed

func Save

func Save(ctx context.Context, l logger.Logger, cfg Config) error

Save saves caches based on the provided configuration and logs results as each cache is processed

Types

type CacheClient

type CacheClient interface {
	Save(ctx context.Context, cacheID string) (zstash.SaveResult, error)
	Restore(ctx context.Context, cacheID string) (zstash.RestoreResult, error)
	ListCaches() []cache.Cache
}

CacheClient defines the interface for cache operations

type Config

type Config struct {
	// BucketURL is the URL of the bucket (e.g., s3://bucket-name)
	BucketURL string
	// Branch is the branch associated with the cache
	Branch string
	// Pipeline is the pipeline slug for this cache
	Pipeline string
	// Organization is the organization slug for this cache
	Organization string
	// CacheConfigFile is the path to the cache configuration YAML file
	CacheConfigFile string
	// Ids is a list of cache IDs (if empty, processes all caches)
	Ids []string
	// APIEndpoint is the Agent API endpoint
	APIEndpoint string
	// APIToken is the access token used to authenticate
	APIToken string
}

Config holds the configuration for cache operations

type FileConfig

type FileConfig struct {
	// Dependencies is the list of dependency caches to restore/save
	Dependencies []cache.Cache `yaml:"dependencies"`
}

FileConfig represents the structure of the cache configuration YAML file

Jump to

Keyboard shortcuts

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