Documentation ¶
Index ¶
- Variables
- type GCS
- func (g *GCS) AllowMissing() bool
- func (g *GCS) Concurrent() bool
- func (g *GCS) CopyBucketToBucket(src, dst string) error
- func (g *GCS) CopyToLocal(gcsPath, dst string) error
- func (g *GCS) CopyToRemote(src, gcsPath string) error
- func (g *GCS) DeletePath(path string) error
- func (g *GCS) GetMarkerPath(bucket, gcsRoot string) (string, error)
- func (g *GCS) GetReleasePath(bucket, gcsRoot, version string, fast bool) (string, error)
- func (g *GCS) IsPathNormalized(gcsPath string) bool
- func (g *GCS) NoClobber() bool
- func (g *GCS) NormalizePath(gcsPathParts ...string) (string, error)
- func (g *GCS) PathExists(gcsPath string) (bool, error)
- func (g *GCS) Recursive() bool
- func (g *GCS) RsyncRecursive(src, dst string) error
- func (g *GCS) SetOptions(opts ...OptFn)
- func (g *GCS) WithAllowMissing(allowMissing bool) OptFn
- func (g *GCS) WithConcurrent(concurrent bool) OptFn
- func (g *GCS) WithNoClobber(noClobber bool) OptFn
- func (g *GCS) WithRecursive(recursive bool) OptFn
- type OptFn
- type Store
Constants ¶
This section is empty.
Variables ¶
var (
// GcsPrefix url prefix for google cloud storage buckets
GcsPrefix = "gs://"
)
Functions ¶
This section is empty.
Types ¶
type GCS ¶
type GCS struct {
// contains filtered or unexported fields
}
func (*GCS) AllowMissing ¶
func (*GCS) Concurrent ¶
func (*GCS) CopyBucketToBucket ¶
CopyBucketToBucket copies between two GCS paths.
func (*GCS) CopyToLocal ¶
CopyToLocal copies a GCS path to the specified local directory
func (*GCS) CopyToRemote ¶
CopyToGCS copies a local directory to the specified GCS path
func (*GCS) DeletePath ¶
DeletePath deletes a bucket location recursevly
func (*GCS) GetMarkerPath ¶
GetMarkerPath returns a GCS path where version markers should be stored
Expected destination format:
gs://<bucket>/<gcsRoot>
func (*GCS) GetReleasePath ¶
GetReleasePath returns a GCS path to retrieve builds from or push builds to
Expected destination format:
gs://<bucket>/<gcsRoot>[/fast][/<version>]
func (*GCS) IsPathNormalized ¶
IsPathNormalized determines if a GCS path is prefixed with `gs://`. Use this function as pre-check for any gsutil/GCS functions that manipulate GCS bucket contents.
func (*GCS) NormalizePath ¶
NormalizeGCSPath takes a GCS path and ensures that the `GcsPrefix` is prepended to it. TODO: Should there be an append function for paths to prevent multiple calls
like in build.checkBuildExists()?
func (*GCS) PathExists ¶
PathExists returns true if the specified GCS path exists.
func (*GCS) RsyncRecursive ¶
RsyncRecursive runs `gsutil rsync` in recursive mode. The caller of this function has to ensure that the provided paths are prefixed with gs:// if necessary (see `NormalizePath()`).
func (*GCS) SetOptions ¶
func (*GCS) WithAllowMissing ¶
func (*GCS) WithConcurrent ¶
func (*GCS) WithNoClobber ¶
func (*GCS) WithRecursive ¶
type Store ¶
type Store interface { // Configure options SetOptions(opts ...OptFn) // Path operations NormalizePath(pathParts ...string) (string, error) IsPathNormalized(path string) bool PathExists(path string) (bool, error) // Copy operations // TODO: Determine if these methods should even be part of the interface // TODO: Maybe overly specific. Consider reducing these down to Copy() CopyToRemote(local, remote string) error CopyToLocal(remote, local string) error CopyBucketToBucket(src, dst string) error RsyncRecursive(src, dst string) error // TODO: Overly specific. We should only care these methods during a release. GetReleasePath(bucket, gcsRoot, version string, fast bool) (string, error) GetMarkerPath(bucket, gcsRoot string) (string, error) }