Documentation ¶
Index ¶
Constants ¶
const LIIDLEN int = 12
LIIDLEN specifiy the len of the LIID number
const META string = "meta.json"
META set the meta file name
Variables ¶
This section is empty.
Functions ¶
func CompressEncrypt ¶
CompressEncrypt compress with zsdt and then encrypt with chacha20-poly1305. After this it will be save the result in out so you can hash the data and not must load it again in mem.
func DecryptDecomp ¶
DecryptDecomp decrypt the input with chacha20-poly1305 and decompress it. After this it will be save the result in out.
func DecryptDecompFile ¶
DecryptDecompFile decrypt the encrypted file with chacha20-poly1305 and decompress it. After this it will be save the result to output file.
func TrimSuffix ¶
TrimSuffix trim the given suffix from string
Types ¶
type Capture ¶
type Capture struct { Compressed int64 Size int64 Hash string // contains filtered or unexported fields }
Capture hold all information about a capture file parsed from filename and fileinfo
type Meta ¶
type Meta struct { LIID string `json:"liid"` Key string `json:"key"` Date string `json:"date"` Count int `json:"count"` Size int64 `json:"size"` Compressed int64 `json:"compressed"` Files map[string]Capture `json:"files"` // contains filtered or unexported fields }
Meta holds the data for one day and file representations. Writes the meta.json file. Use NewMeta for a new struct.
type Node ¶
Node is the local instance holds his keypair and the shared secret
func (Node) Pack ¶
Pack use a input folder and a output folder to collect all files and compress and encrypt the files. if move is true the files will be deleted in the input folder
func (Node) Pull ¶
Pull fetch files from remote. If hash change a error msg will be printed. If a file in remote will be deleted after download it will not be synced.
type SSHClient ¶
type SSHClient struct {
// contains filtered or unexported fields
}
SSHClient holds all information to connect to a ssh server
func NewSSHClient ¶
NewSSHClient create a new ssh client with connection informations After creation use SetKeyAuth or SetPassAuth for auth method.
func (*SSHClient) Close ¶
func (c *SSHClient) Close()
Close the session and the client connection to server
func (*SSHClient) SetKeyAuth ¶
SetKeyAuth use a keyfile to authenticate to the ssh server
func (*SSHClient) SetPassAuth ¶
SetPassAuth use the password authentication to connect to ssh server