storages

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storager

type Storager interface {
	// GetCwd - get current working directory (CWD) path
	GetCwd() string
	// Dirname - returns current dirname without prefix
	Dirname() string
	// ListDir - walking through storage and returns directories and files in the cwd
	ListDir(ctx context.Context) (files []string, dirs []Storager, err error)
	// GetObject - returns ReadCloser by the provided path
	GetObject(ctx context.Context, filePath string) (reader io.ReadCloser, err error)
	// PutObject - puts data to the provided file path
	PutObject(ctx context.Context, filePath string, body io.Reader) error
	// Delete - delete list of objects by the provided paths
	Delete(ctx context.Context, filePaths ...string) error
	// Exists - check object existence
	Exists(ctx context.Context, fileName string) (bool, error)
	// SubStorage - get new Storage instance with the samo config but change current cwd via subPath
	// If relative == true then path is sub folder in cwd
	SubStorage(subPath string, relative bool) Storager
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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