Documentation ¶
Overview ¶
package mirror is used upload and download Bazel dependencies to and from a mirror.
Index ¶
Constants ¶
View Source
const ( // DryRun is a flag to enable dry run mode. DryRun = true // Run is a flag to perform actual operations. Run = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Maintainer ¶
type Maintainer struct {
// contains filtered or unexported fields
}
Maintainer can upload and download files to and from a CAS mirror.
func New ¶
func New(ctx context.Context, region, bucket, mirrorBaseURL string, dryRun bool, log *slog.Logger) (*Maintainer, error)
New creates a new Maintainer that can upload and download files to and from a CAS mirror.
func NewUnauthenticated ¶
func NewUnauthenticated(mirrorBaseURL string, dryRun bool, log *slog.Logger) *Maintainer
NewUnauthenticated creates a new Maintainer that dose not require authentication can only download files from a CAS mirror.
func (*Maintainer) Check ¶
func (m *Maintainer) Check(ctx context.Context, expectedHash string) error
Check checks if a file is present and has the correct hash in the CAS mirror.
func (*Maintainer) Learn ¶
Learn downloads a file from one of the existing (non-mirror) urls, hashes it and returns the hash.
Click to show internal directories.
Click to hide internal directories.