vault

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteVaultFile

func DeleteVaultFile(path string) error

func GetDeletedFiles

func GetDeletedFiles() (any, error)

func GetFileData

func GetFileData(uid int) (*[]byte, error)

func GetFileHistory

func GetFileHistory(path string) (*[]File, error)

func GetVaultFiles

func GetVaultFiles(vaultID string) (*[]File, error)

func GetVaultSize

func GetVaultSize(vaultID string) (int64, error)

func InsertData

func InsertData(uid int, data *[]byte) error

func InsertMetadata

func InsertMetadata(vaultID string, file File) (int, error)

func Snapshot

func Snapshot(vaultID string) error

Sets the newest files to also be snapshots and deletes all files which are not snapshots deletes all files where size is not 0 but data is null

Types

type File

type File struct {
	Op          string `json:"op,omitempty"`
	Path        string `json:"path"`
	Hash        string `json:"hash,omitempty"`
	Extension   string `json:"extension,omitempty"`
	Size        int64  `json:"size"`
	Created     int64  `json:"ctime,omitempty"`
	Modified    int64  `json:"mtime,omitempty"`
	Timestamp   int64  `json:"ts,omitempty"`
	RelatedPath string `json:"related_path,omitempty"`
	Folder      bool   `json:"folder"`
	Deleted     bool   `json:"deleted"`
	UID         int    `json:"uid"`
	Data        []byte `json:"-"`
}

func GetFile

func GetFile(uid int) (*File, error)

func RestoreFile

func RestoreFile(uid int) (*File, error)

type Share added in v0.0.1

type Share struct {
	Accepted bool   `json:"accepted"`
	Email    string `json:"email"`
	Name     string `json:"name"`
	UID      string `json:"uid"`
}

type Vault

type Vault struct {
	ID        string `json:"id"`
	UserEmail string `json:"user_email,omitempty"`
	Created   int64  `json:"created"`
	Host      string `json:"host"`
	Name      string `json:"name"`
	Password  string `json:"password"`
	Salt      string `json:"salt"`
	Size      int64  `json:"size"`
	// Not part of JSON
	Version int `json:"-"`
}

Jump to

Keyboard shortcuts

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