Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBIDCollision = errors.New("A colliding BID has been found") ErrBIDNotFound = errors.New("A blob with given BID was not found") )
View Source
var ( ErrInsufficientKeySource = errors.New("Not enough data to create a proper encryption key") ErrInvalidKey = errors.New("Invalid key") ErrUnknownKeyType = errors.New("Unknown key type") )
View Source
var ( ErrInvalidValidationMethod = errors.New("Invalid blob validation method") ErrInvalidFileBlobType = errors.New("Invalid blob type - not a file blob") ErrInvalidSplitFileSize = errors.New("Invalid size of a split file") ErrMalformedSplitFileSizePartsCount = errors.New("Invalid split file blob - number of partial blobs is incorrect") ErrMalformedSplitFileExtraData = errors.New("Invalid split file blob - extra bytes found at the end of the blob") ErrMalformedSplitFileExtraDataPart = errors.New("Invalid split file blob - extra bytes found at the end of the partial blob") ErrInvalidFileSubBlobType = errors.New("Invalid sub blob type - not a file blob") ErrMalformedDirInvalidEntriesCount = errors.New("Invalid directory blob - incorrect number of entries found") ErrMalformedDirExtraData = errors.New("Invalid directory blob - extra bytes found at the end") ErrNoMoreDirEntries = errors.New("No more directory entries found") ErrInvalidPublicKeyBid = errors.New("Invalid public key - does not match blob id") ErrUnknownPublicKeyType = errors.New("Unknown public key type") )
View Source
var ( ErrDeserializeStringToLarge = errors.New("Could not deserialize string value due to invalid length") ErrDeserializeStringNotUTF8 = errors.New("Could not deserialize string value - not a UTF-8 sequence") )
Functions ¶
This section is empty.
Types ¶
type BlobStorage ¶
type BlobStorage interface { // Create new writer for blobs NewBlobWriter(blobId string) (writer WriteFinalizeCanceler, err error) // Create new reader for existing blob NewBlobReader(blobId string) (reader io.Reader, err error) }
An interface usefull for blob storage operations
func NewFileBlobStorage ¶
func NewFileBlobStorage(path string) BlobStorage
func NewMemoryBlobStorage ¶
func NewMemoryBlobStorage() BlobStorage
type DirBlobReader ¶
type DirBlobReader interface { // Open blob for reading Open(bid, key string) error // Test whether there's any more entry left IsNextEntry() bool // Get the next entry from the reader NextEntry() (DirEntry, error) }
func NewDirBlobReader ¶
func NewDirBlobReader(storage BlobStorage) DirBlobReader
type DirBlobWriter ¶
type DirBlobWriter struct { // Storage Object Storage BlobStorage // contains filtered or unexported fields }
Structure used for creating new directory blobs
func (*DirBlobWriter) AddEntry ¶
func (d *DirBlobWriter) AddEntry(entry DirEntry) error
Adds a new entry to the directory TODO: Don't allow adding duplicated entries
type DirEntry ¶
type DirEntry struct {
Name, MimeType, Bid, Key string
}
Helper structure for holding one directory entry
type FileBlobReader ¶
func NewFileBlobReader ¶
func NewFileBlobReader(storage BlobStorage) FileBlobReader
type FileBlobWriter ¶
type FileBlobWriter struct { // Storage object Storage BlobStorage // contains filtered or unexported fields }
Structure used to generate static file blobs
func (*FileBlobWriter) Cancel ¶
func (f *FileBlobWriter) Cancel()
Cancel the generation of file blob.
Note that if there were blobs generated so far, they won't be removed. The current implementation allows such garbage favouring the simplicity of implementation.
type WriteFinalizeCanceler ¶
Click to show internal directories.
Click to hide internal directories.