record

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Uuid       string // unique id, gdrive resource id
	ClearHash  string // hash of cleartext bytes, prefixed with the algorithm used
	Length     uint64 // length of actual content without padding and prefixes and stuff, used to truncate file after decryption
	KeyInfo    []byte // key information: secret key and info about which encryption algorighm is used
	CipherHash string // hash of ciphertext bytes, prefixed with the algorithm used
}

func NewChunk added in v0.7.0

func NewChunk(id string, clearhash string, length uint64, keyinfo []byte, cipherhash string) Chunk

type Record

type Record struct {
	Uuid     string     // unique id
	Machine  string     // machine name whence it was uploaded from
	Path     string     // absolute path
	Versions []Revision // list of versions of the file, sorted by descending date (newest is Versions[0])
}

func NewRecord added in v0.7.0

func NewRecord(path, machine string) Record

func (*Record) First

func (f *Record) First() *Revision

func (*Record) Latest

func (f *Record) Latest() *Revision

type Revision

type Revision struct {
	Uuid   string    // unique id
	Hash   string    // cleartext hash prefixed with the algorithm used
	Size   uint64    // byte size of the clear text file
	Date   time.Time // date uploaded
	Chunks []Chunk   // list of encrypted blobs that make up this file version
}

func NewRevision added in v0.7.0

func NewRevision(hash string, size uint64) Revision

Jump to

Keyboard shortcuts

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