fs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureStorage

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

AzureStorage stores files on Azure Blob Storage

func (*AzureStorage) Delete

func (f *AzureStorage) Delete(name string, tag interface{}) (err error)

func (*AzureStorage) Get

func (f *AzureStorage) Get(name string, out io.Writer, metadataCb crypto.MetadataCb) (found bool, tag interface{}, err error)

func (*AzureStorage) GetInfoFile

func (f *AzureStorage) GetInfoFile() (info *infofile.InfoFile, err error)

func (*AzureStorage) Init

func (f *AzureStorage) Init(connection string) error

func (*AzureStorage) Set

func (f *AzureStorage) Set(name string, in io.Reader, tag interface{}, metadata *crypto.Metadata) (tagOut interface{}, err error)

func (*AzureStorage) SetDataPath added in v0.3.0

func (f *AzureStorage) SetDataPath(path string)

func (*AzureStorage) SetInfoFile

func (f *AzureStorage) SetInfoFile(info *infofile.InfoFile) (err error)

func (*AzureStorage) SetMasterKey

func (f *AzureStorage) SetMasterKey(key []byte)

type Fs

type Fs interface {
	// Init the object, by passing a connection string
	Init(connection string) error

	// SetDataPath sets the path where the data is stored (read from the info file)
	SetDataPath(path string)

	// SetMasterKey sets the master passphrase (used to encrypt/decrypt files) in the object
	SetMasterKey(key []byte)

	// GetInfoFile returns the contents of the info file
	GetInfoFile() (info *infofile.InfoFile, err error)

	// SetInfoFile stores the info file
	SetInfoFile(info *infofile.InfoFile) (err error)

	// Get returns a stream to a file in the filesystem
	// It also returns a tag (which might be empty) that should be passed to the Set method if you want to subsequentially update the contents of the file
	Get(name string, out io.Writer, metadataCb crypto.MetadataCb) (found bool, tag interface{}, err error)

	// Set writes a stream to the file in the filesystem
	// If you pass a tag, the implementation might use that to ensure that the file on the filesystem hasn't been changed since it was read (optional)
	Set(name string, in io.Reader, tag interface{}, metadata *crypto.Metadata) (tagOut interface{}, err error)

	// Delete a file from the filesystem
	// If you pass a tag, the implementation might use that to ensure that the file on the filesystem hasn't been changed since it was read (optional)
	Delete(name string, tag interface{}) (err error)
}

Fs is the interface for the filesystem

func Get

func Get(connection string) (store Fs, err error)

Get returns a store for the given connection string

type Local

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

Local is the local file system This implementation does not rely on tags, as it's assumed that concurrency isn't an issue on a single machine

func (*Local) Delete

func (f *Local) Delete(name string, tag interface{}) (err error)

func (*Local) Get

func (f *Local) Get(name string, out io.Writer, metadataCb crypto.MetadataCb) (found bool, tag interface{}, err error)

func (*Local) GetInfoFile

func (f *Local) GetInfoFile() (info *infofile.InfoFile, err error)

func (*Local) Init

func (f *Local) Init(connection string) error

func (*Local) Set

func (f *Local) Set(name string, in io.Reader, tag interface{}, metadata *crypto.Metadata) (tagOut interface{}, err error)

func (*Local) SetDataPath added in v0.3.0

func (f *Local) SetDataPath(path string)

func (*Local) SetInfoFile

func (f *Local) SetInfoFile(info *infofile.InfoFile) (err error)

func (*Local) SetMasterKey

func (f *Local) SetMasterKey(key []byte)

type S3 added in v0.1.1

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

S3 stores files on a S3-compatible service This implementation does not rely on tags because S3 does not support conditional put requests

func (*S3) Delete added in v0.1.1

func (f *S3) Delete(name string, tag interface{}) (err error)

func (*S3) Get added in v0.1.1

func (f *S3) Get(name string, out io.Writer, metadataCb crypto.MetadataCb) (found bool, tag interface{}, err error)

func (*S3) GetInfoFile added in v0.1.1

func (f *S3) GetInfoFile() (info *infofile.InfoFile, err error)

func (*S3) Init added in v0.1.1

func (f *S3) Init(connection string) error

func (*S3) Set added in v0.1.1

func (f *S3) Set(name string, in io.Reader, tag interface{}, metadata *crypto.Metadata) (tagOut interface{}, err error)

func (*S3) SetDataPath added in v0.3.0

func (f *S3) SetDataPath(path string)

func (*S3) SetInfoFile added in v0.1.1

func (f *S3) SetInfoFile(info *infofile.InfoFile) (err error)

func (*S3) SetMasterKey added in v0.1.1

func (f *S3) SetMasterKey(key []byte)

Jump to

Keyboard shortcuts

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