gcsfilestore

package
v1.2.33 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGcsFile

func NewGcsFile(uri string) fs.IFile

func NewGcsFileStore

func NewGcsFileStore(uri string) fs.IFileStore

NewGcsFileStore factory method

Types

type GcsFile

type GcsFile struct {
	// contains filtered or unexported fields
}

GcsFile is a concrete implementation of Google Cloud Storage file

func (*GcsFile) Close

func (t *GcsFile) Close() (err error)

Close client to free resources

func (*GcsFile) Copy

func (t *GcsFile) Copy(wc io.WriteCloser) (written int64, err error)

Copy file content to a writer

func (*GcsFile) Delete

func (t *GcsFile) Delete() (err error)

Delete a file

func (*GcsFile) Exists

func (t *GcsFile) Exists() (result bool)

Exists test if file exists

func (*GcsFile) Read

func (t *GcsFile) Read(p []byte) (int, error)

Read implements io.Reader interface

func (*GcsFile) ReadAll

func (t *GcsFile) ReadAll() (b []byte, err error)

ReadAll read resource content to a byte array in a single call

func (*GcsFile) Rename

func (t *GcsFile) Rename(pattern string) (string, error)

Rename change the resource name using pattern. The pattern can be a file or keeping parts from the original file using template ({{path}}, {{file}}, {{ext}})

func (*GcsFile) URI

func (t *GcsFile) URI() string

URI returns the resource URI with schema Schema can be: file, gcs, http etc

func (*GcsFile) Write

func (t *GcsFile) Write(p []byte) (int, error)

Write implements io.Writer interface

func (*GcsFile) WriteAll

func (t *GcsFile) WriteAll(b []byte) (n int, err error)

WriteAll write content to a resource in a single call

type GcsFileStore

type GcsFileStore struct {
	// contains filtered or unexported fields
}

GcsFileStore is a concrete implementation of Google Cloud Storage

func (*GcsFileStore) Apply

func (f *GcsFileStore) Apply(filter string, action func(string)) error

Apply action on files in the file store

func (*GcsFileStore) Delete

func (f *GcsFileStore) Delete(uri string) (err error)

Delete resource

func (*GcsFileStore) Exists

func (f *GcsFileStore) Exists(uri string) (result bool)

Exists test for resource existence

func (*GcsFileStore) List

func (f *GcsFileStore) List(filter string) ([]fs.IFile, error)

List files in the file store

func (*GcsFileStore) URI

func (f *GcsFileStore) URI() string

URI returns the resource URI with schema Schema can be: file, gcs, http etc

Jump to

Keyboard shortcuts

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