gcs

package
v1.413.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTargetFolder

func GetTargetFolder(folderPath string, stepResultType string, subFolder string) string

GetTargetFolder calculates the target folder in GCS bucket

func NewClient

func NewClient(opts ...gcsOption) (*gcsClient, error)

Init intitializes the google cloud storage client

func PersistReportsToGCS

func PersistReportsToGCS(gcsClient Client, outputParams []ReportOutputParam, inputParams map[string]string, gcsFolderPath string, gcsBucketID string, gcsSubFolder string, searchFilesFunc func(string) ([]string, error), fileInfo func(string) (os.FileInfo, error)) error

func WithClientOptions

func WithClientOptions(opts ...option.ClientOption) gcsOption

WithEnvVars initializes the Google Cloud Storage client options

func WithCreateFileFunction

func WithCreateFileFunction(createFile func(name string) (io.WriteCloser, error)) gcsOption

WithEnvVars initializes the createFile function in gcsClient

func WithEnvVars

func WithEnvVars(envVars []EnvVar) gcsOption

WithEnvVars initializes env variables in gcsClient

func WithOpenFileFunction

func WithOpenFileFunction(openFile func(name string) (io.ReadCloser, error)) gcsOption

WithEnvVars initializes the openFile function in gcsClient

Types

type Client

type Client interface {
	UploadFile(bucketID string, sourcePath string, targetPath string) error
	DownloadFile(bucketID string, sourcePath string, targetPath string) error
	ListFiles(bucketID string) ([]string, error)
	Close() error
}

Client is an interface to mock gcsClient

type EnvVar

type EnvVar struct {
	Name     string
	Value    string
	Modified bool
}

EnvVar defines an environment variable incl. information about a potential modification to the variable

type ReportOutputParam

type ReportOutputParam struct {
	FilePattern    string
	ParamRef       string
	StepResultType string
}

type Task

type Task struct {
	SourcePath string
	TargetPath string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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