blob

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// Optional parameters.
	ioStorage.Options
	// contains filtered or unexported fields
}

Reader represents GCP storage reader.

func NewReader

func NewReader(
	ctx context.Context,
	client *azblob.Client,
	containerName string,
	opts ...ioStorage.Opt,
) (*Reader, error)

NewReader returns new Azure blob directory/file reader. Must be called with WithDir(path string) or WithFile(path string) - mandatory. Can be called with WithValidator(v validator) - optional.

func (*Reader) GetNumber

func (r *Reader) GetNumber() int64

GetNumber returns the number of asb/asbx files/dirs that was initialized.

func (*Reader) GetSize

func (r *Reader) GetSize() int64

GetSize returns the size of asb/asbx file/dir that was initialized.

func (*Reader) GetType

func (r *Reader) GetType() string

GetType return `gcpStorageType` type of storage. Used in logging.

func (*Reader) ListObjects

func (r *Reader) ListObjects(ctx context.Context, path string) ([]string, error)

ListObjects list all object in the path.

func (*Reader) SetObjectsToStream

func (r *Reader) SetObjectsToStream(list []string)

SetObjectsToStream set objects to stream.

func (*Reader) StreamFile

func (r *Reader) StreamFile(
	ctx context.Context, filename string, readersCh chan<- models.File, errorsCh chan<- error)

StreamFile opens a single file from GCP cloud storage and sends io.Readers to the `readersCh` In case of an error, it is sent to the `errorsCh` channel.

func (*Reader) StreamFiles

func (r *Reader) StreamFiles(
	ctx context.Context, readersCh chan<- models.File, errorsCh chan<- error,
)

StreamFiles streams file/directory form GCP cloud storage to `readersCh`. If error occurs, it will be sent to `errorsCh.`

type Writer

type Writer struct {
	// Optional parameters.
	ioStorage.Options
	// contains filtered or unexported fields
}

Writer represents a GCP storage writer.

func NewWriter

func NewWriter(
	ctx context.Context,
	client *azblob.Client,
	containerName string,
	opts ...ioStorage.Opt,
) (*Writer, error)

func (*Writer) GetType

func (w *Writer) GetType() string

GetType return `gcpStorageType` type of storage. Used in logging.

func (*Writer) NewWriter

func (w *Writer) NewWriter(ctx context.Context, filename string) (io.WriteCloser, error)

NewWriter returns a new Azure blob writer to the specified path.

func (*Writer) Remove

func (w *Writer) Remove(ctx context.Context, targetPath string) error

Remove deletes the file or directory contents specified by path.

func (*Writer) RemoveFiles

func (w *Writer) RemoveFiles(ctx context.Context) error

RemoveFiles removes a backup file or files from directory.

Jump to

Keyboard shortcuts

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