googlecloud

package
v0.0.0-...-f81bbf2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleCloudStorage

type GoogleCloudStorage struct {
	knoxite.StorageFilesystem
	// contains filtered or unexported fields
}

GoogleCloudStorage stores data in a Google Cloud Storage bucket.

func (*GoogleCloudStorage) AvailableSpace

func (backend *GoogleCloudStorage) AvailableSpace() (uint64, error)

AvailableSpace returns the free space on this backend.

func (*GoogleCloudStorage) Close

func (backend *GoogleCloudStorage) Close() error

Close the backend.

func (*GoogleCloudStorage) CreatePath

func (backend *GoogleCloudStorage) CreatePath(path string) error

CreatePath is not needed in Google Cloud Storage backend because paths are automatically created when writing a file.

func (*GoogleCloudStorage) DeleteFile

func (backend *GoogleCloudStorage) DeleteFile(path string) error

DeleteFile deletes a file from Google Cloud Storage.

func (*GoogleCloudStorage) Description

func (backend *GoogleCloudStorage) Description() string

Description returns a user-friendly description for this backend.

func (*GoogleCloudStorage) Location

func (backend *GoogleCloudStorage) Location() string

Location returns the type and location of the repository.

func (*GoogleCloudStorage) NewBackend

func (*GoogleCloudStorage) NewBackend(URL url.URL) (knoxite.Backend, error)

NewBackend returns a GoogleCloudStorage backend to create a storage client we need either the path to a credential JSON file set via the environment variable GOOGLE_APPLICATION_CREDENTIALS="[PATH]" or the path to the JSON file passed via the user parameter of the URL scheme.

func (*GoogleCloudStorage) Protocols

func (backend *GoogleCloudStorage) Protocols() []string

Protocols returns the Protocol Schemes supported by this backend.

func (*GoogleCloudStorage) ReadFile

func (backend *GoogleCloudStorage) ReadFile(path string) ([]byte, error)

ReadFile reads a file from Google Cloud Storage.

func (*GoogleCloudStorage) Stat

func (backend *GoogleCloudStorage) Stat(path string) (uint64, error)

Stat returns the size of a file.

func (*GoogleCloudStorage) WriteFile

func (backend *GoogleCloudStorage) WriteFile(path string, data []byte) (size uint64, err error)

WriteFile writes a file on Google Cloud Storage.

Jump to

Keyboard shortcuts

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