Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigDir ¶
func ConfigDir() string
ConfigDir identifies the correct path to store persistent configuration data on various operating systems.
func NewNonce ¶
func NewNonce() []byte
NewNonce generates a random Nonce for AES-GCM. It panics if the source of randomness fails.
func NewSymmetricKey ¶
func NewSymmetricKey() *[32]byte
NewSymmetricKey generates a random 256-bit AES key for File{}s. It panics if the source of randomness fails.
Types ¶
type Chunk ¶
type Chunk struct {
Index int
Sha256 []byte
Nonce []byte // If encrypted, use this Nonce to store/retrieve the Sum.
}
Chunk represents a portion of the content of the File being stored.
type File ¶
type File struct {
// Filename is a fully qualified path, with no leading slash.
Filename string
Filesize int64 // Bytes
// ModifiedTime represents the "commit" time of this File object. A given
// Filename is represented by the valid File with the latest ModifiedTime.
ModifiedTime time.Time
// Chunks represets an ordered list of the bytes in the file.
Chunks []Chunk
// Chunksize is the maximum size of each plaintext Chunk, in bytes.
Chunksize int
// LastChunksize is the size of the last chunk in the File. Storing this
// explicity avoids the need to fetch the last chunk to update the Filesize.
LastChunksize int
// Deleted indicates all previous versions of this file should be suppressed.
Deleted bool
// AesKey is a 256 bit key used to encrypt the Chunks with AES-GCM. If no
// key is provided, the blocks are not encrypted. The GCM nonce is stored at
// the front of the encrypted Chunk using gcm.Seal(); use gcm.Open() to
// recover the Nonce when decrypting. Nb: This increases the encrypted
// Chunk's size by gcm.NonceSize(), currently 12 bytes.
AesKey *[32]byte
}
File represents the metadata of a file stored in Shade. It is stored and retrieved by the drive.Client API, and boiled down
func NewFile ¶
NewFile returns a new File object for the given filename.
It initializes an AesKey, sets the ModifiedTime to time.Now(), and sets the default Chunksize based on --chunksize.
func (*File) FromJSON ¶
FromJSON populates the fields of this File struct from a JSON representation. It primarily provides a convenient error message if this fails.
func (*File) UpdateFilesize ¶
func (f *File) UpdateFilesize()
UpdateFilesize calculates the size of the assocaited Chunks and sets the Filesize member of the struct.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
shade
command
shade presents a fuse filesystem interface.
|
shade presents a fuse filesystem interface. |
|
shadeutil
command
shadeutil contains tools for inspecting shade repositories.
|
shadeutil contains tools for inspecting shade repositories. |
|
throw
command
throw stores a file in the cloud, encrypted.
|
throw stores a file in the cloud, encrypted. |
|
Package config reads and parses a JSON config which must represent a single Drive object.
|
Package config reads and parses a JSON config which must represent a single Drive object. |
|
cache
Package cache is an interface to multiple storage backends for Shade.
|
Package cache is an interface to multiple storage backends for Shade. |
|
encrypt
Package encrypt is an interface to manage encrypted storage backends.
|
Package encrypt is an interface to manage encrypted storage backends. |
|
fail
Package fail is a test client.
|
Package fail is a test client. |
|
google
Package google provides a Shade storage implementation for Google Drive.
|
Package google provides a Shade storage implementation for Google Drive. |
|
google/zerobyte
command
zerobyte iterates all the shade files, reads their first byte, and adds it as a Property of the file.
|
zerobyte iterates all the shade files, reads their first byte, and adds it as a Property of the file. |
|
local
Package local is a persistent local storage backend for Shade.
|
Package local is a persistent local storage backend for Shade. |
|
memory
Package memory is an in memory storage backend for Shade.
|
Package memory is an in memory storage backend for Shade. |
|
win
Package win is a test client.
|
Package win is a test client. |
|
Package umbrella provides utility functions to maintain your Shade repository, such as cleaning up orphaned files and chunks.
|
Package umbrella provides utility functions to maintain your Shade repository, such as cleaning up orphaned files and chunks. |