Documentation ¶
Index ¶
- func CreateExpireFileName(expTime time.Duration) string
- func Init()
- func ParseURL(u string) string
- func PullFileGCS(dstFilename, u string, force bool) (ok bool)
- func PullGCS(dst, src string, force bool) (ok bool)
- func PullPaths(dst, src string) (string, string)
- func PushGCS(dst, src, expires string, force bool) (ok bool)
- func PushPaths(dst, src string) (string, string)
- func UploadFile(u, filename string) (ok bool)
- func YankGCS(name string) (ok bool)
- func YankPath(f string) string
- type GenerateSignedURLsRequest
- type GenerateSignedURLsResponse
- type SignedURL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateExpireFileName ¶ added in v0.2.0
CreateExpireFileName creates a new name for an expire descriptor file on the Google Cloud Storage.
func Init ¶ added in v0.4.0
func Init()
Init initializes Google Coud Storage with the given bucket name in environment variable. Loads credentials from environment variable too.
func PullFileGCS ¶
PullFileGCS downloads a file from the Google Cloud Storage to the file system with given source path.
func PullGCS ¶
PullGCS downloads a file or directory from the Google Cloud Storage to the file system with given destination and source path.
func PullPaths ¶
PullPaths returns source and destination paths to pull a file from Google Cloud Storage. Source path becomes a category prefixed path to the GCS Bucket, destination path becomes a relative path on the file system.
func PushGCS ¶
PushGCS uploads a file or directory from the file system to Google Cloud Storage to given destination with a human readable expire string. Returns if it was a success, otherwise the error has been logged.
func PushPaths ¶
PushPaths returns source and destination paths to push a file to Google Cloud Storage. Source path becomes a relative path on the file system, destination path becomes a category prefixed path to the GCS Bucket.
func UploadFile ¶ added in v0.2.0
UploadFile uploads a file given by its filename to the Google Cloud Storage.
Types ¶
type GenerateSignedURLsRequest ¶ added in v0.2.0
type GenerateSignedURLsRequest struct { Paths []string `json:"paths,omitempty"` Type generateSignedURLsRequestType `json:"type,omitempty"` }
GenerateSignedURLsRequest is the request for Push call. Contains a list of paths to upload, and if it's forced.
type GenerateSignedURLsResponse ¶ added in v0.2.0
type GenerateSignedURLsResponse struct { Urls []*SignedURL `json:"urls,omitempty"` Error string `json:"error,omitempty"` }
GenerateSignedURLsResponse contain a list of Signed URLs. It can be used for multiple grcp calls.