arcpics

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 16 Imported by: 0

README

arcpics

arcpics: Manage archived pictures not only at external hard drives.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkippedByUser = "error - skipped by user"
View Source
var FILES_BUCKET = []byte("FILES")
View Source
var HelpTextFmt = `` /* 1046-byte string literal not displayed */
View Source
var INIT_LABEL_KEY = "ARC-PICS-LABEL-KEY"
View Source
var LABEL_SUMMARY_fmt = "LABEL-%s-SUMMARY"
View Source
var SYSTEM_BUCKET = []byte("SYSTEM")
View Source
var Verbose bool = false
View Source
var Version string = "0.0.3"

line:

duplicate Windows — Shift + Alt + Up/Down
select    Windows/Ubuntu — Ctrl + L
delete    Windows/Ubuntu — Ctrl + Shift + K
move Windows/Ubuntu — Alt + Up/Down arrow

Functions

func ArcpicsAllKeys

func ArcpicsAllKeys(db *bolt.DB) []string

func ArcpicsDatabaseUpdate

func ArcpicsDatabaseUpdate(db *bolt.DB, arcFS ArcpicsFS) error

Updating database according to the directory tree json files

func ArcpicsFiles2DB added in v0.0.3

func ArcpicsFiles2DB(db *bolt.DB, arcFS ArcpicsFS) error

Writting the directory tree json files to database

func ArcpicsFilesUpdate

func ArcpicsFilesUpdate(arcFS ArcpicsFS) error

Updating directory tree json files according to dir content

func ArcpicsQuery added in v0.0.3

func ArcpicsQuery(db *bolt.DB, query string)

func ArcpicsWordFrequency added in v0.0.3

func ArcpicsWordFrequency(db *bolt.DB)

func CmdHelp added in v0.0.3

func CmdHelp(msg string) string

func CopyDirFromTo

func CopyDirFromTo(fromSrc, toDst string) error

CopyDirFromTo copies the content of Src to Dst.

func CreateDirJson

func CreateDirJson(jfname string, jDir JdirType) error

func CreateLabelFile added in v0.0.3

func CreateLabelFile(dirName, newLabel string) error

func DbLabel

func DbLabel(archiveDir string) (string, error)

func DirCount

func DirCount(fsys fs.FS) (countDir int, totalPathLength int)

func DirExists added in v0.0.3

func DirExists(filename string) bool

func DirFilesCount

func DirFilesCount(fsys fs.FS) (int, int)

func FileExists added in v0.0.3

func FileExists(filename string) bool

returns exists and isFile

func FilesCount

func FilesCount(fsys fs.FS) (count int)

func GetDatabaseDirName

func GetDatabaseDirName() string

func GetDbValue

func GetDbValue(db *bolt.DB, bucket []byte, key string) string

func GetLabelsInDbDir

func GetLabelsInDbDir(d string) ([]string, error)

func LabeledDatabase

func LabeledDatabase(label string, varArgs ...string) (*bolt.DB, error)

func PurgeJson__

func PurgeJson__(dir string) error

func PutDbValue

func PutDbValue(db *bolt.DB, bucket []byte, key, value string) error

func UpdateDirJson

func UpdateDirJson(fjson string, jDir JdirType) error

func Web added in v0.0.3

func Web(port int)

Types

type ArcpicsFS

type ArcpicsFS struct {
	Dir   string
	Label string
}

File system ArcpicsFS has to have at root special label file with name "arcpics-db-label" and at least one character long arbitrary extension. For example file "arcpics-db-label.a" has label value "a" or "arcpics-db-label.my1TB_hard_drive" has label value "my1TB_hard_drive"

ATTENTION!! ArcpicsFS work fine with fs.WalkDir unless there are any file operations Then use filepath.WalkDir(ArcpicsFS.Dir,...

func AssignPicturesDirectoryWithDatabase

func AssignPicturesDirectoryWithDatabase(varArgs ...string) (ArcpicsFS, *bolt.DB, error)

func OpenArcpicsFS

func OpenArcpicsFS(dir string) (ArcpicsFS, error)

func (ArcpicsFS) DirPaths

func (afs ArcpicsFS) DirPaths() ([]string, error)

func (ArcpicsFS) DirPathsUpdate

func (afs ArcpicsFS) DirPathsUpdate() error

func (ArcpicsFS) Open

func (afs ArcpicsFS) Open(name string) (fs.File, error)

type JdirType

type JdirType = struct {
	Description string      `json:",omitempty"`
	MostComment string      `json:",omitempty"`
	Location    string      `json:",omitempty"`
	Skip        []string    `json:",omitempty"`
	Files       []JfileType `json:",omitempty"`
	Dirs        []string    `json:",omitempty"`
}

type JfileType

type JfileType = struct {
	Name      string
	Size      string
	Time      string //
	Comment   string `json:",omitempty"`
	Thumbnail []byte `json:",omitempty"`
}

type LabelMountsType added in v0.0.3

type LabelMountsType map[string]string
var LabelMounts LabelMountsType = make(map[string]string)

func (*LabelMountsType) Get added in v0.0.3

func (lm *LabelMountsType) Get(label string) string

func (*LabelMountsType) Html added in v0.0.3

func (lm *LabelMountsType) Html(label string) string

func (*LabelMountsType) Set added in v0.0.3

func (lm *LabelMountsType) Set(label string, value string)

Directories

Path Synopsis
Package jpeg implements decoding of jpeg file
Package jpeg implements decoding of jpeg file
cmd

Jump to

Keyboard shortcuts

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