filestore

package
v6.0.0-...-cfe9101 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: AGPL-3.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestFilePath = "/testfile"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileBackend

type FileBackend interface {
	TestConnection() error

	Reader(path string) (ReadCloseSeeker, error)
	ReadFile(path string) ([]byte, error)
	FileExists(path string) (bool, error)
	FileSize(path string) (int64, error)
	CopyFile(oldPath, newPath string) error
	MoveFile(oldPath, newPath string) error
	WriteFile(fr io.Reader, path string) (int64, error)
	AppendFile(fr io.Reader, path string) (int64, error)
	RemoveFile(path string) error
	FileModTime(path string) (time.Time, error)

	ListDirectory(path string) ([]string, error)
	ListDirectoryRecursively(path string) ([]string, error)
	RemoveDirectory(path string) error
}

func NewFileBackend

func NewFileBackend(settings FileBackendSettings) (FileBackend, error)

type FileBackendSettings

type FileBackendSettings struct {
	DriverName              string
	Directory               string
	AmazonS3AccessKeyId     string
	AmazonS3SecretAccessKey string
	AmazonS3Bucket          string
	AmazonS3PathPrefix      string
	AmazonS3Region          string
	AmazonS3Endpoint        string
	AmazonS3SSL             bool
	AmazonS3SignV2          bool
	AmazonS3SSE             bool
	AmazonS3Trace           bool
}

func (*FileBackendSettings) CheckMandatoryS3Fields

func (settings *FileBackendSettings) CheckMandatoryS3Fields() error

type LocalFileBackend

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

func (*LocalFileBackend) AppendFile

func (b *LocalFileBackend) AppendFile(fr io.Reader, path string) (int64, error)

func (*LocalFileBackend) CopyFile

func (b *LocalFileBackend) CopyFile(oldPath, newPath string) error

func (*LocalFileBackend) FileExists

func (b *LocalFileBackend) FileExists(path string) (bool, error)

func (*LocalFileBackend) FileModTime

func (b *LocalFileBackend) FileModTime(path string) (time.Time, error)

func (*LocalFileBackend) FileSize

func (b *LocalFileBackend) FileSize(path string) (int64, error)

func (*LocalFileBackend) ListDirectory

func (b *LocalFileBackend) ListDirectory(path string) ([]string, error)

func (*LocalFileBackend) ListDirectoryRecursively

func (b *LocalFileBackend) ListDirectoryRecursively(path string) ([]string, error)

func (*LocalFileBackend) MoveFile

func (b *LocalFileBackend) MoveFile(oldPath, newPath string) error

func (*LocalFileBackend) ReadFile

func (b *LocalFileBackend) ReadFile(path string) ([]byte, error)

func (*LocalFileBackend) Reader

func (b *LocalFileBackend) Reader(path string) (ReadCloseSeeker, error)

func (*LocalFileBackend) RemoveDirectory

func (b *LocalFileBackend) RemoveDirectory(path string) error

func (*LocalFileBackend) RemoveFile

func (b *LocalFileBackend) RemoveFile(path string) error

func (*LocalFileBackend) TestConnection

func (b *LocalFileBackend) TestConnection() error

func (*LocalFileBackend) WriteFile

func (b *LocalFileBackend) WriteFile(fr io.Reader, path string) (int64, error)

type ReadCloseSeeker

type ReadCloseSeeker interface {
	io.ReadCloser
	io.Seeker
}

type S3FileBackend

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

S3FileBackend contains all necessary information to communicate with an AWS S3 compatible API backend.

func NewS3FileBackend

func NewS3FileBackend(settings FileBackendSettings) (*S3FileBackend, error)

NewS3FileBackend returns an instance of an S3FileBackend.

func (*S3FileBackend) AppendFile

func (b *S3FileBackend) AppendFile(fr io.Reader, path string) (int64, error)

func (*S3FileBackend) CopyFile

func (b *S3FileBackend) CopyFile(oldPath, newPath string) error

func (*S3FileBackend) FileExists

func (b *S3FileBackend) FileExists(path string) (bool, error)

func (*S3FileBackend) FileModTime

func (b *S3FileBackend) FileModTime(path string) (time.Time, error)

func (*S3FileBackend) FileSize

func (b *S3FileBackend) FileSize(path string) (int64, error)

func (*S3FileBackend) ListDirectory

func (b *S3FileBackend) ListDirectory(path string) ([]string, error)

func (*S3FileBackend) ListDirectoryRecursively

func (b *S3FileBackend) ListDirectoryRecursively(path string) ([]string, error)

func (*S3FileBackend) MakeBucket

func (b *S3FileBackend) MakeBucket() error

func (*S3FileBackend) MoveFile

func (b *S3FileBackend) MoveFile(oldPath, newPath string) error

func (*S3FileBackend) ReadFile

func (b *S3FileBackend) ReadFile(path string) ([]byte, error)

func (*S3FileBackend) Reader

func (b *S3FileBackend) Reader(path string) (ReadCloseSeeker, error)

Caller must close the first return value

func (*S3FileBackend) RemoveDirectory

func (b *S3FileBackend) RemoveDirectory(path string) error

func (*S3FileBackend) RemoveFile

func (b *S3FileBackend) RemoveFile(path string) error

func (*S3FileBackend) TestConnection

func (b *S3FileBackend) TestConnection() error

func (*S3FileBackend) WriteFile

func (b *S3FileBackend) WriteFile(fr io.Reader, path string) (int64, error)

type S3FileBackendAuthError

type S3FileBackendAuthError struct {
	DetailedError string
}

func (*S3FileBackendAuthError) Error

func (s *S3FileBackendAuthError) Error() string

type S3FileBackendNoBucketError

type S3FileBackendNoBucketError struct{}

S3FileBackendNoBucketError is returned when testing a connection and no S3 bucket is found

func (*S3FileBackendNoBucketError) Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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