Documentation
¶
Index ¶
- type Opt
- func WithDir(path string) Opt
- func WithDirList(pathList []string) Opt
- func WithFile(path string) Opt
- func WithFileList(pathList []string) Opt
- func WithNestedDir() Opt
- func WithRemoveFiles() Opt
- func WithSkipDirCheck() Opt
- func WithStartAfter(v string) Opt
- func WithUploadConcurrency(v int) Opt
- func WithValidator(v validator) Opt
- type Reader
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
type Opt func(*options)
func WithDirList ¶ added in v0.3.0
WithDirList adds a directory list to read files from. Is used only for Reader.
func WithFileList ¶ added in v0.3.0
WithFileList adds a file list to read from. Is used only for Reader.
func WithNestedDir ¶
func WithNestedDir() Opt
WithNestedDir adds withNestedDir = true parameter. That means that we won't skip nested folders.
func WithRemoveFiles ¶
func WithRemoveFiles() Opt
WithRemoveFiles adds remove files flag, so all files will be removed from backup folder before backup. Is used only for Writer.
func WithSkipDirCheck ¶
func WithSkipDirCheck() Opt
WithSkipDirCheck adds skip dir check flags. Which means that backup directory won't be checked for emptiness.
func WithStartAfter ¶
WithStartAfter adds start after parameter to list request. The Value of start after will be not included in a result. You will receive objects after this parameter. Is used only for Reader.
func WithUploadConcurrency ¶
WithUploadConcurrency define max number of concurrent uploads to be performed to upload the file. Is used only for Writer.
func WithValidator ¶
func WithValidator(v validator) Opt
WithValidator adds validator to Reader, so files will be validated before reading. Is used only for Reader.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader represents GCP storage reader.
func NewReader ¶
func NewReader( ctx context.Context, client *azblob.Client, containerName string, opts ...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) StreamFile ¶
func (r *Reader) StreamFile( ctx context.Context, filename string, readersCh chan<- io.ReadCloser, 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<- io.ReadCloser, 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 {
// contains filtered or unexported fields
}
Writer represents a GCP storage writer.