file

package
v0.0.0-...-0a07c0b Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package file exports a generic file interface that we use to access Google Cloud Storage. None of the functions here are unit-testable because they are all either interfaces or connect to Google Cloud Storage, which cannot be unit tested.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object interface {
	GetWriter(ctx context.Context) io.WriteCloser
	DeleteFile(ctx context.Context) error
	CopyTo(ctx context.Context, filename string) error
}

Object is the mockable interface to the functionality we need from a single CGS object.

type Store

type Store interface {
	GetFile(name string) Object
	NamesToMD5(ctx context.Context, prefix string) map[string][]byte
}

Store is the mockable interface to the functionality we need from CGS.

func NewGCSStore

func NewGCSStore(bkt *storage.BucketHandle) Store

NewGCSStore adapts a bucket handle into a file.Store.

Jump to

Keyboard shortcuts

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