Documentation
¶
Index ¶
- Variables
- func Checksum(source io.Reader) (string, error)
- func ChecksumOfFile(path string) (string, error)
- func DeleteFileGroup(fgi FileGroupInfo, logger log.Logger)
- func DownloadFileFromBuildCache(ctx context.Context, fileName, key string, kvClient *kv.Client, ...) error
- func DownloadStreamFromBuildCache(ctx context.Context, destination io.Writer, key string, kvClient *kv.Client, ...) error
- func GetCacheKey(envProvider func(string) string, keyParams CacheKeyParams) (string, error)
- func RestoreDirectoryInfos(dirInfos []*DirectoryInfo, rootDir string, logger log.Logger) error
- func RestoreFileInfos(fileInfos []*FileInfo, rootDir string, logger log.Logger) (int, error)
- func RestoreSymlinks(symlinks []*SymlinkInfo, logger log.Logger) (int, error)
- func SaveMetadata(metadata *Metadata, fileName string, logger log.Logger) (int64, error)
- func UploadFileToBuildCache(ctx context.Context, filePath, key string, kvClient *kv.Client, ...) error
- func UploadStreamToBuildCache(ctx context.Context, source io.Reader, key string, size int64, ...) error
- type CacheKeyParams
- type CreateMetadataParams
- type DefaultStepAnalyticsTracker
- func (t *DefaultStepAnalyticsTracker) LogDerivedDataDownloaded(duration time.Duration, stats DownloadFilesStats)
- func (t *DefaultStepAnalyticsTracker) LogDerivedDataUploaded(duration time.Duration, stats UploadFilesStats)
- func (t *DefaultStepAnalyticsTracker) LogMetadataLoaded(duration time.Duration, cacheKeyType string, totalFileCount int, ...)
- func (t *DefaultStepAnalyticsTracker) LogMetadataSaved(duration time.Duration, fileCount int, size int64)
- func (t *DefaultStepAnalyticsTracker) LogRestoreFinished(totalDuration time.Duration, err error)
- func (t *DefaultStepAnalyticsTracker) LogSaveFinished(totalDuration time.Duration, err error)
- func (t *DefaultStepAnalyticsTracker) Wait()
- type DirectoryInfo
- type DownloadFilesStats
- type FileGroupInfo
- type FileInfo
- type Metadata
- type StepAnalyticsTracker
- type SymlinkInfo
- type UploadFilesStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCacheNotFound = errors.New("no cache archive found for the provided keys")
ErrCacheNotFound ...
View Source
var ErrFileExistsAndNotWritable = errors.New("file already exists and is not writable")
ErrFileExistsAndNotWritable ...
Functions ¶
func ChecksumOfFile ¶
func DeleteFileGroup ¶
func DeleteFileGroup(fgi FileGroupInfo, logger log.Logger)
func GetCacheKey ¶
func GetCacheKey(envProvider func(string) string, keyParams CacheKeyParams) (string, error)
func RestoreDirectoryInfos ¶
func RestoreDirectoryInfos(dirInfos []*DirectoryInfo, rootDir string, logger log.Logger) error
func RestoreFileInfos ¶
func RestoreSymlinks ¶
func RestoreSymlinks(symlinks []*SymlinkInfo, logger log.Logger) (int, error)
func SaveMetadata ¶
func UploadFileToBuildCache ¶
Types ¶
type CacheKeyParams ¶
type CacheKeyParams struct {
IsFallback bool
}
type CreateMetadataParams ¶
type DefaultStepAnalyticsTracker ¶
type DefaultStepAnalyticsTracker struct {
// contains filtered or unexported fields
}
func NewDefaultStepTracker ¶
func (*DefaultStepAnalyticsTracker) LogDerivedDataDownloaded ¶
func (t *DefaultStepAnalyticsTracker) LogDerivedDataDownloaded(duration time.Duration, stats DownloadFilesStats)
func (*DefaultStepAnalyticsTracker) LogDerivedDataUploaded ¶
func (t *DefaultStepAnalyticsTracker) LogDerivedDataUploaded(duration time.Duration, stats UploadFilesStats)
func (*DefaultStepAnalyticsTracker) LogMetadataLoaded ¶
func (*DefaultStepAnalyticsTracker) LogMetadataSaved ¶
func (t *DefaultStepAnalyticsTracker) LogMetadataSaved(duration time.Duration, fileCount int, size int64)
func (*DefaultStepAnalyticsTracker) LogRestoreFinished ¶
func (t *DefaultStepAnalyticsTracker) LogRestoreFinished(totalDuration time.Duration, err error)
func (*DefaultStepAnalyticsTracker) LogSaveFinished ¶
func (t *DefaultStepAnalyticsTracker) LogSaveFinished(totalDuration time.Duration, err error)
func (*DefaultStepAnalyticsTracker) Wait ¶
func (t *DefaultStepAnalyticsTracker) Wait()
type DirectoryInfo ¶
type DownloadFilesStats ¶
type DownloadFilesStats struct { FilesToBeDownloaded int FilesDownloaded int FilesMissing int FilesFailedToDownload int DownloadSize int64 LargestFileSize int64 }
func DownloadCacheFilesFromBuildCache ¶
func DownloadCacheFilesFromBuildCache(ctx context.Context, dd FileGroupInfo, kvClient *kv.Client, logger log.Logger, isDebugLogMode, skipExisting, forceOverwrite bool, maxLoggedDownloadErrors int) (DownloadFilesStats, error)
nolint: gocognit
type FileGroupInfo ¶
type FileGroupInfo struct { Files []*FileInfo `json:"files"` Directories []*DirectoryInfo `json:"directories"` Symlinks []*SymlinkInfo `json:"symlinks,omitempty"` }
type Metadata ¶
type Metadata struct { ProjectFiles FileGroupInfo `json:"projectFiles"` DerivedData FileGroupInfo `json:"derivedData"` XcodeCacheDir FileGroupInfo `json:"xcodeCacheDir"` CacheKey string `json:"cacheKey"` CreatedAt time.Time `json:"createdAt"` AppID string `json:"appId,omitempty"` BuildID string `json:"buildId,omitempty"` WorkspaceID string `json:"workspaceId,omitempty"` GitCommit string `json:"gitCommit,omitempty"` GitBranch string `json:"gitBranch,omitempty"` BuildCacheCLIVersion string `json:"cliVersion,omitempty"` MetadataVersion int `json:"metadataVersion"` }
func CreateMetadata ¶
type StepAnalyticsTracker ¶
type StepAnalyticsTracker interface { LogMetadataSaved(duration time.Duration, fileCount int, size int64) LogDerivedDataUploaded(duration time.Duration, stats UploadFilesStats) LogSaveFinished(totalDuration time.Duration, err error) LogMetadataLoaded(duration time.Duration, cacheKeyType string, totalFileCount int, restoredFileCount int, size int64) LogDerivedDataDownloaded(duration time.Duration, stats DownloadFilesStats) LogRestoreFinished(totalDuration time.Duration, err error) Wait() }
type SymlinkInfo ¶
type UploadFilesStats ¶
type UploadFilesStats struct { FilesToUpload int FilesUploaded int FilesFailedToUpload int TotalFiles int UploadSize int64 LargestFileSize int64 }
func UploadCacheFilesToBuildCache ¶
func UploadCacheFilesToBuildCache(ctx context.Context, dd FileGroupInfo, kvClient *kv.Client, logger log.Logger) (UploadFilesStats, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.