kv

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCacheNotFound ...
	ErrCacheNotFound        = errors.New("no cache archive found for the provided keys")
	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) ChangeSession added in v1.0.2

func (c *Client) ChangeSession(invocationID string, appSlug string, buildSlug string, stepSlug string)

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) GetCapabilitiesWithRetry added in v1.0.2

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

func (*Client) SetLogger added in v1.0.2

func (c *Client) SetLogger(logger log.Logger)

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
	BitriseKVClient     kv_storage.KVStorageClient
	CapabilitiesClient  remoteexecution.CapabilitiesClient
	InvocationID        string
	DownloadRetry       uint
	DownloadRetryWait   time.Duration
	UploadRetry         uint
	UploadRetryWait     time.Duration
}

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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