Documentation
¶
Index ¶
- Variables
- func DownloadGCS(remoteSource string, localTarget string) error
- func DownloadS3(remoteSource string, localTarget string) error
- func GetByteHash(bt []byte) string
- func GetFileHash(path string) string
- func GetStringHash(plainString string) string
- func IsDir(path string) bool
- func IsGCS(source string) bool
- func IsS3(source string) bool
- func ShortGCSExtract(source string) (string, string, error)
- func ShortS3Extract(source string) (string, string, string, error)
- func StringInSlice(a string, list []string) bool
- func UploadGCS(localSource string, remoteTarget string, permissionName string, ...) error
- func UploadS3(localSource string, remoteTarget string, permissionName string, ...) error
- func WriteReaderToFile(r io.Reader, dest string) error
- type FileWalk
- type ParamArg
Constants ¶
This section is empty.
Variables ¶
var GCSCredentialSession context.Context
GCSCredentialSession the GCS credential session
var GCSCredentialSessionDefined bool
GCSCredentialSessionDefined when true that means the credential for GCS is defined
var S3Region string
S3Region global default region
var S3Regions = []string{"us-east-1", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "sa-east-1"}
S3Regions is list of s3 regions
Functions ¶
func DownloadGCS ¶
DownloadGCS to download GCS file from remote source to local file target
func DownloadS3 ¶
DownloadS3 to download s3 file from remote source to local file target
func GetByteHash ¶
GetByteHash will return hex sha264 of specified byte sequence
func GetFileHash ¶
GetFileHash will return string hash of specified file
func GetStringHash ¶
GetStringHash will return string hash of specified string
func ShortGCSExtract ¶
ShortGCSExtract will extract GCS short path into bucket, path string
func ShortS3Extract ¶
ShortS3Extract to extract our short s3 path to region, bucket, path components
func StringInSlice ¶
StringInSlice Return true if a is in the list slice
func UploadGCS ¶
func UploadGCS(localSource string, remoteTarget string, permissionName string, storageClass string) error
UploadGCS to be used to upload local-file to target s3 path in our short notation gs://bucket/path
Types ¶
type FileWalk ¶
type FileWalk chan string
FileWalk type channel that represent interation trough a path
func (FileWalk) IterateUpload ¶
IterateUpload will walk the files in the walker and call callback to upload it one by one