kv

package
v0.17.9 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheNotFound = errors.New("no cache archive found for the provided keys")

ErrCacheNotFound ...

View Source
var ErrCacheUnauthenticated = errors.New("unauthenticated")
View Source
var ErrFileExistsAndNotWritable = errors.New("file already exists and is not writable")

ErrFileExistsAndNotWritable ...

Functions

func ParseURLGRPC

func ParseURLGRPC(s string) (string, bool, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(p NewClientParams) (*Client, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, name string) error

func (*Client) DownloadFile added in v0.15.3

func (c *Client) DownloadFile(ctx context.Context, filePath, key string, fileMode os.FileMode, isDebugLogMode, skipExisting, forceOverwrite bool) (bool, error)

nolint: nestif

func (*Client) DownloadFileFromBuildCache added in v0.15.3

func (c *Client) DownloadFileFromBuildCache(ctx context.Context, fileName, key string) error

func (*Client) DownloadFileGroupFromBuildCache added in v0.15.3

func (c *Client) DownloadFileGroupFromBuildCache(ctx context.Context, dd filegroup.Info,
	isDebugLogMode, skipExisting, forceOverwrite bool, maxLoggedDownloadErrors int) (DownloadFilesStats, error)

nolint: gocognit

func (*Client) DownloadStream added in v0.15.3

func (c *Client) DownloadStream(ctx context.Context, destination io.Writer, key string) error

func (*Client) DownloadStreamFromBuildCache added in v0.15.3

func (c *Client) DownloadStreamFromBuildCache(ctx context.Context, destination io.Writer, key string) error

func (*Client) FindMissing

func (c *Client) FindMissing(ctx context.Context, digests []*FileDigest) ([]*FileDigest, error)

func (*Client) GetCapabilities

func (c *Client) GetCapabilities(ctx context.Context) error

func (*Client) InitiateGet added in v0.15.4

func (c *Client) InitiateGet(ctx context.Context, name string) (io.ReadCloser, error)

func (*Client) InitiatePut added in v0.15.4

func (c *Client) InitiatePut(ctx context.Context, params PutParams) (io.WriteCloser, error)

func (*Client) UploadFileGroupToBuildCache added in v0.15.3

func (c *Client) UploadFileGroupToBuildCache(ctx context.Context, dd filegroup.Info) (UploadFilesStats, error)

func (*Client) UploadFileToBuildCache added in v0.15.3

func (c *Client) UploadFileToBuildCache(ctx context.Context, filePath, key string) error

func (*Client) UploadStreamToBuildCache added in v0.15.3

func (c *Client) UploadStreamToBuildCache(ctx context.Context, source io.Reader, key string, size int64) error

type DownloadFilesStats added in v0.15.3

type DownloadFilesStats struct {
	FilesToBeDownloaded   int
	FilesDownloaded       int
	FilesMissing          int
	FilesFailedToDownload int
	DownloadSize          int64
	LargestFileSize       int64
}

type FileDigest

type FileDigest struct {
	Sha256Sum   string
	SizeInBytes int64
}

type NewClientParams

type NewClientParams struct {
	UseInsecure         bool
	Host                string
	DialTimeout         time.Duration
	ClientName          string
	AuthConfig          common.CacheAuthConfig
	CacheConfigMetadata common.CacheConfigMetadata
	Logger              log.Logger
	CacheOperationID    string
}

type PutParams

type PutParams struct {
	Name      string
	Sha256Sum string
	FileSize  int64
}

type UploadFilesStats added in v0.15.3

type UploadFilesStats struct {
	FilesToUpload       int
	FilesUploaded       int
	FilesFailedToUpload int
	TotalFiles          int
	UploadSize          int64
	LargestFileSize     int64
}

Jump to

Keyboard shortcuts

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