Documentation ¶
Index ¶
- type FS
- func (fs *FS) CopyPart(srcFS common.OriginFS, p common.Part) error
- func (fs *FS) CreateFile(filePath string, data []byte) error
- func (fs *FS) DeleteFile(filePath string) error
- func (fs *FS) DeletePart(p common.Part) error
- func (fs *FS) DownloadPart(p common.Part, w io.Writer) error
- func (fs *FS) HasFile(filePath string) (bool, error)
- func (fs *FS) Init() error
- func (fs *FS) ListParts() ([]common.Part, error)
- func (fs *FS) MustStop()
- func (fs *FS) ReadFile(filePath string) ([]byte, error)
- func (fs *FS) RemoveEmptyDirs() error
- func (fs *FS) String() string
- func (fs *FS) UploadPart(p common.Part, r io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct { // Path to GCP credentials file. // // Default credentials are used if empty. CredsFilePath string // GCS bucket to use. Bucket string // Directory in the bucket to write to. Dir string // contains filtered or unexported fields }
FS represents filesystem for backups in GCS.
Init must be called before calling other FS methods.
func (*FS) CreateFile ¶
CreateFile creates filePath at fs and puts data into it.
The file is overwritten if it exists.
func (*FS) DeleteFile ¶
DeleteFile deletes filePath at fs if it exists.
The function does nothing if the filePath doesn't exists.
func (*FS) DeletePart ¶
DeletePart deletes part p from fs.
func (*FS) DownloadPart ¶
DownloadPart downloads part p from fs to w.
func (*FS) Init ¶
Init initializes fs.
The returned fs must be stopped when no long needed with MustStop call.
func (*FS) RemoveEmptyDirs ¶
RemoveEmptyDirs recursively removes empty dirs in fs.
Click to show internal directories.
Click to hide internal directories.