gcs

package
v0.0.0-...-87426b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(ctx context.Context, serviceAccount string) error

Authenticate explicitly sets up authentication for the rest of run

func BuildLogPath

func BuildLogPath(gcsURL string) (string, error)

BuildLogPath returns the build log path from the test result gcsURL

func Copy

func Copy(ctx context.Context, srcBucketName, srcPath, dstBucketName, dstPath string) error

Copy file from within gcs

func Download

func Download(ctx context.Context, bucketName, srcPath, dstPath string) error

Download file from gcs

func Exists

func Exists(ctx context.Context, bucketName, storagePath string) bool

Exists checks if path exist under gcs bucket, this path can either be a directory or a file.

func GetConsoleURL

func GetConsoleURL(gcsURL string) (string, error)

GetConsoleURL returns the gcs link renderable directly from a browser

func ListChildrenFiles

func ListChildrenFiles(ctx context.Context, bucketName, storagePath string) []string

ListChildrenFiles recursively lists all children files.

func ListDirectChildren

func ListDirectChildren(ctx context.Context, bucketName, storagePath string) []string

ListDirectChildren lists direct children paths (including files and directories).

func NewReader

func NewReader(ctx context.Context, bucketName, filePath string) (*storage.Reader, error)

NewReader creates a new Reader of a gcs file. Important: caller must call Close on the returned Reader when done reading

func Read

func Read(ctx context.Context, bucketName, filePath string) ([]byte, error)

Read reads the specified file

func ReadURL

func ReadURL(ctx context.Context, gcsURL string) ([]byte, error)

ReadURL reads from a gsUrl and return a log structure

func Upload

func Upload(ctx context.Context, bucketName, dstPath, srcPath string) error

Upload file to gcs

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL