gcs

package
v1.485.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 WithCreateFileFunction

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

WithCreateFileFunction sets the createFile function in gcsClient

func WithGCSClientOptions added in v1.429.0

func WithGCSClientOptions(opts ...option.ClientOption) clientOptions

WithGCSClientOptions sets the Google Cloud Storage client options

func WithOpenFileFunction

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

WithOpenFileFunction sets the openFile function in gcsClient

Types

type Client

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

Client is an interface to mock gcsClient

func NewClient

func NewClient(keyFile, token string, opts ...clientOptions) (Client, error)

NewClient initializes the Google Cloud Storage client with the provided options

func NewClientLegacy added in v1.429.0

func NewClientLegacy(opts ...clientOptions) (Client, error)

NewClientLegacy is also still here because of integration tests

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