Documentation ¶
Index ¶
- func ConfigPath() string
- func GetFileModificationTime(attrs *storage.ObjectAttrs) time.Time
- func ParseFileModificationTimeMetadata(attrs *storage.ObjectAttrs) time.Time
- type GCS
- func (g *GCS) AttemptLock(bucket, object string, ttl time.Duration)
- func (g *GCS) AttemptUnLock(bucket, object string)
- func (g *GCS) Attributes(bucket, prefix string) *system.Attrs
- func (g *GCS) BatchAttributes(bucket, prefix string, recursive bool) []*system.Attrs
- func (g *GCS) Cat(bucket, prefix string) []byte
- func (g *GCS) Copy(srcBucket, srcPrefix, dstBucket, dstPrefix string)
- func (g *GCS) Delete(bucket, prefix string)
- func (g *GCS) DeleteObject(bucket, prefix string) error
- func (g *GCS) DiskUsage(bucket, prefix string, recursive bool) []system.DiskUsage
- func (g *GCS) DoAttemptLock(bucket, object string, ttl time.Duration) (int64, error)
- func (g *GCS) DoAttemptUnlock(bucket, object string, generation int64) error
- func (g *GCS) Download(bucket, prefix, dstFile string, forceChecksum bool, ctx system.RunContext)
- func (g *GCS) GCSAttrs(bucket, prefix string) *storage.ObjectAttrs
- func (g *GCS) GetObjectReader(bucket, prefix string) (io.ReadCloser, error)
- func (g *GCS) GetObjectWriter(bucket, prefix string) io.WriteCloser
- func (g *GCS) IsDirectory(bucket, prefix string) bool
- func (g *GCS) IsObject(bucket, prefix string) bool
- func (g *GCS) List(bucket, prefix string, recursive bool) []*system.FileObject
- func (g *GCS) Move(srcBucket, srcPrefix, dstBucket, dstPrefix string)
- func (g *GCS) MustEqualCRC32C(flag bool, localPath, bucket, object string)
- func (g *GCS) Scheme() string
- func (g *GCS) Upload(srcFile, bucket, object string, ctx system.RunContext)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileModificationTime ¶
func GetFileModificationTime(attrs *storage.ObjectAttrs) time.Time
GetFileModificationTime get file modification time
func ParseFileModificationTimeMetadata ¶
func ParseFileModificationTimeMetadata(attrs *storage.ObjectAttrs) time.Time
ParseFileModificationTimeMetadata parsed reserved modification time from metadata
Types ¶
type GCS ¶
type GCS struct {
// contains filtered or unexported fields
}
func (*GCS) AttemptLock ¶
AttemptLock attempts to write a remote lock file
func (*GCS) AttemptUnLock ¶
AttemptUnLock attempts to release a remote lock file
func (*GCS) Attributes ¶
GetObjectAttributes gets the attributes of an object
func (*GCS) BatchAttributes ¶
GetObjectsAttributes gets the attributes of all the objects under a prefix
func (*GCS) DeleteObject ¶
func (*GCS) DoAttemptLock ¶
DoAttemptLock returns generation and potential error
func (*GCS) DoAttemptUnlock ¶
DoAttemptUnlock takes generation as input and returns potential error
func (*GCS) Download ¶
func (g *GCS) Download( bucket, prefix, dstFile string, forceChecksum bool, ctx system.RunContext, )
DownloadObjectWithWorkerPool downloads a specific byte range of an object to a file.
func (*GCS) GetObjectReader ¶
func (g *GCS) GetObjectReader(bucket, prefix string) (io.ReadCloser, error)
func (*GCS) GetObjectWriter ¶
func (g *GCS) GetObjectWriter(bucket, prefix string) io.WriteCloser
func (*GCS) IsDirectory ¶
IsDirectory checks if is a directory case 1: gs://abc/def -> gs://abc/def/ : true case 2: gs://abc/de -> gs://abc/def/ : false case 3: gs://abc/def/ -> gs://abc/def/ : true case 4: gs://abc/def -> gs://abc/def : false
func (*GCS) IsObject ¶
IsObject checks if is an object case 1: gs://abc/def -> gs://abc/def/ : false case 2: gs://abc/de -> gs://abc/def/ : false case 3: gs://abc/def/ -> gs://abc/def/ : false case 4: gs://abc/def -> gs://abc/def : true
func (*GCS) List ¶
func (g *GCS) List(bucket, prefix string, recursive bool) []*system.FileObject
List objects under a prefix
func (*GCS) MustEqualCRC32C ¶
MustEqualCRC32C compare CRC32C values if flag is set - compare a local file with an object from gcp - exit process if values are different