connector

package
v0.0.0-...-36df34d Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONNECTOR_TYPE_LOCAL = "local"
	CONNECTOR_TYPE_S3    = "s3"

	FS_SYS_DIR_ADMIN      = "admin"
	FS_SYS_DIR_DATA       = "data"
	DATA_GROUP_PREFIX_LEN = 1
)

Variables

This section is empty.

Functions

func Write

func Write(connector Connector, fileInfo *dirent.Dirent,
	blockCipher cipher.Block, clearbytes io.Reader) (uint64, string, error)

A convenience function for synchronious writes. Returns: (size, md5 hash (hex), error).

Types

type Connector

type Connector interface {
	// Every connector should be able to construct a unique id for itself
	// that is the same for each backend.
	GetId() string
	// Prepare the backend storage for initialization.
	PrepareStorage() error
	// Get a reader that transparently handles all decryption.
	GetCipherReader(fileInfo *dirent.Dirent, blockCipher cipher.Block) (util.ReadSeekCloser, error)
	// Metadata may be stored in a different way than normal files.
	GetMetadataReader(metadataId string, blockCipher cipher.Block, iv []byte) (util.ReadSeekCloser, error)
	GetCipherWriter(fileInfo *dirent.Dirent, blockCipher cipher.Block) (*cipherio.CipherWriter, error)
	GetMetadataWriter(metadataId string, blockCipher cipher.Block, iv []byte) (*cipherio.CipherWriter, error)
	RemoveMetadataFile(metadataId string) error
	RemoveFile(file *dirent.Dirent) error
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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