common

package
v0.0.0-...-776acb3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIFileStatusAvailable  = "available"
	APIFileStatusRetrieving = "retrieving"
	APIFileStatusUnsealing  = "unsealing"
)

File status (for download)

View Source
const (
	APIPushStatusPushing = "pushing"
	APIPushStatusSuccess = "success"
	APIPushStatusError   = "error"
)

Pusher status (for download)

View Source
const BarrySignature = "BARRY1"
View Source
const ClientVersion = "1.10.0"

ClientVersion of the client (x.y.z format)

View Source
const EncryptionIvSize = 16
View Source
const ProtocolVersion = 2

ProtocolVersion implemented

View Source
const ServerVersion = "0.21.0"

ServerVersion of the server

View Source
const TrueStr = "true"

TrueStr is the true truth.

Variables

This section is empty.

Functions

func CleanURL

func CleanURL(urlIn string) (string, error)

CleanURL by parsing it

func DecryptFile

func DecryptFile(infile *os.File, outfile *os.File, keyCallback func(string) ([]byte, error)) error

DecryptFile will decrypt a file, where you must provide a callback to return the key

func InterfaceValueToString

func InterfaceValueToString(iv interface{}, format string) string

InterfaceValueToString converts most interface types to string

func PathExist

func PathExist(path string) bool

PathExist returns true if a file or directory exists

func ReadString

func ReadString(file *os.File, maxLen int) (string, error)

ReadString read a string from a file, byte by byte, until null (slow but convenient)

Types

type APIDestinationEntries

type APIDestinationEntries []APIDestinationEntry

APIDestinationEntries is a list of entries for "get destinations" command

type APIDestinationEntry

type APIDestinationEntry struct {
	Name string
	Type string
}

APIDestinationEntry is an entry for a destination

type APIFileListEntries

type APIFileListEntries []APIFileListEntry

APIFileListEntries is a list of file entries

type APIFileListEntry

type APIFileListEntry struct {
	Filename      string
	ModTime       time.Time
	Size          int64
	ExpireLocal   time.Time // expiration date
	ExpireRemote  time.Time // (same)
	RemoteKeep    time.Duration
	ExpiredLocal  bool
	ExpiredRemote bool
	Container     string
	Retrieved     bool
	Encrypted     bool
}

APIFileListEntry is a file entry

type APIFileStatus

type APIFileStatus struct {
	Status string
	ETA    time.Duration
}

APIFileStatus is the status of a file from barryd PoV

type APIKeyListEntries

type APIKeyListEntries []APIKeyListEntry

APIKeyListEntries is a list of entries for "backup list" command

type APIKeyListEntry

type APIKeyListEntry struct {
	Comment string
}

APIKeyListEntry is an entry for a backup

type APIProjectInfos

type APIProjectInfos struct {
	FileCountCurrent    int
	SizeCountCurrent    int64   `format:"size"`
	CostCurrent         float64 `format:"money"`
	Archived            bool
	BackupEvery         time.Duration
	NewestModTime       time.Time
	FinalExpiration     time.Time
	LocalExpirationStr  string
	RemoteExpirationStr string
}

APIProjectInfos contains informations about a project

type APIProjectListEntries

type APIProjectListEntries []APIProjectListEntry

APIProjectListEntries is a list of project entries

type APIProjectListEntry

type APIProjectListEntry struct {
	Path             string
	FileCountCurrent int
	SizeCountCurrent int64
	CostCurrent      float64
	Archived         bool
}

APIProjectListEntry is a project entry

type APIPushStatus

type APIPushStatus struct {
	Status string
	ETA    time.Duration
	Error  string
}

APIPushStatus is the status of a pusher

type APIStatus

type APIStatus struct {
	Version          string
	StartTime        time.Time
	ProjectCount     int
	FileCount        int
	TotalFileSize    int64   `format:"size"`
	TotalFileCost    float64 `format:"money"`
	UploadQueueSize  int
	EncryptQueueSize int
	Uploaders        []string `format:"ignore"`
	Encrypters       []string `format:"ignore"`
}

APIStatus describes server status

Jump to

Keyboard shortcuts

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