eaglexport

package
v0.0.0-...-34f93e4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportOption

type ExportOption struct {
	// Overwrite the existing file
	Overwrite bool

	// Force clean up the destination directory before export
	Force bool

	// GroupBySmartFolder export group by smart folder
	GroupBySmartFolder bool

	SpeedBar *mpb.Bar
	ItemBar  *mpb.Bar
}

type FileDispatcher

type FileDispatcher struct {
	// contains filtered or unexported fields
}

func NewFolderFilter

func NewFolderFilter(meta *LibraryInfo) FileDispatcher

func (FileDispatcher) Evaluate

func (f FileDispatcher) Evaluate(fileInfo *FileInfo) (string, error)

type FileInfo

type FileInfo struct {
	ID               string    `json:"id,omitempty"`
	Name             string    `json:"name,omitempty"`
	Size             int       `json:"size,omitempty"`
	Btime            int64     `json:"btime,omitempty"`
	Mtime            int64     `json:"mtime,omitempty"`
	Ext              string    `json:"ext,omitempty"`
	Tags             []any     `json:"tags,omitempty"`
	Folders          []any     `json:"folders,omitempty"`
	IsDeleted        bool      `json:"isDeleted,omitempty"`
	URL              string    `json:"url,omitempty"`
	Annotation       string    `json:"annotation,omitempty"`
	ModificationTime int64     `json:"modificationTime,omitempty"`
	Height           int       `json:"height,omitempty"`
	Width            int       `json:"width,omitempty"`
	Palettes         []Palette `json:"palettes,omitempty"`
	DeletedTime      int64     `json:"deletedTime,omitempty"`
	LastModified     int64     `json:"lastModified,omitempty"`
}

type History

type History struct {
	// contains filtered or unexported fields
}

func NewHistory

func NewHistory(path string) (*History, error)

func (*History) Append

func (r *History) Append(h HistoryEntry) error

func (*History) Close

func (r *History) Close()

func (*History) Get

func (r *History) Get(path string) (time.Time, bool)

func (*History) Load

func (r *History) Load()

type HistoryEntry

type HistoryEntry struct {
	Path  string    `json:"path"`
	MTime time.Time `json:"mtime"`
}

type Library

type Library struct {
	// contains filtered or unexported fields
}

func NewLibrary

func NewLibrary(baseDir string, fs afero.Fs, history *History) *Library

func (*Library) Close

func (e *Library) Close()

func (*Library) Export

func (e *Library) Export(outputDir string, option ExportOption) error

type LibraryInfo

type LibraryInfo struct {
	Folders            []any         `json:"folders,omitempty"`
	SmartFolders       []SmartFolder `json:"smartFolders,omitempty"`
	QuickAccess        []any         `json:"quickAccess,omitempty"`
	TagsGroups         []any         `json:"tagsGroups,omitempty"`
	ModificationTime   int64         `json:"modificationTime,omitempty"`
	ApplicationVersion string        `json:"applicationVersion,omitempty"`
}

type Mtime

type Mtime = map[string]int64

type Palette

type Palette struct {
	Color []int   `json:"color"`
	Ratio float32 `json:"ratio"`
}

type SmartFolder

type SmartFolder struct {
	ID               string                 `json:"id,omitempty"`
	Name             string                 `json:"name,omitempty"`
	Description      string                 `json:"description,omitempty"`
	ModificationTime int64                  `json:"modificationTime,omitempty"`
	Conditions       []SmartFolderCondition `json:"conditions,omitempty"`
	Children         []any                  `json:"children,omitempty"`
}

type SmartFolderCondition

type SmartFolderCondition struct {
	Rules   []SmartFolderRule `json:"rules"`
	Match   string            `json:"match"`
	Boolean string            `json:"boolean"`
}

func (*SmartFolderCondition) Eval

func (c *SmartFolderCondition) Eval(fileInfo *FileInfo) bool

type SmartFolderRule

type SmartFolderRule struct {
	Property string `json:"property"`
	Method   string `json:"method"`
	Value    string `json:"value"`
}

func (*SmartFolderRule) Eval

func (r *SmartFolderRule) Eval(fileInfo *FileInfo) bool

type SmbFs

type SmbFs struct {
	Conn    net.Conn
	Session *smb2.Session
	Share   *smb2.Share
}

func NewSmbFs

func NewSmbFs(address string, shareName string, option SmbFsOption) (*SmbFs, error)

func (*SmbFs) Chmod

func (s *SmbFs) Chmod(name string, mode os.FileMode) error

func (*SmbFs) Chown

func (s *SmbFs) Chown(name string, uid, gid int) error

func (*SmbFs) Chtimes

func (s *SmbFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*SmbFs) Close

func (s *SmbFs) Close() error

func (*SmbFs) Create

func (s *SmbFs) Create(name string) (afero.File, error)

func (*SmbFs) Mkdir

func (s *SmbFs) Mkdir(name string, perm os.FileMode) error

func (*SmbFs) MkdirAll

func (s *SmbFs) MkdirAll(path string, perm os.FileMode) error

func (*SmbFs) Name

func (s *SmbFs) Name() string

func (*SmbFs) Open

func (s *SmbFs) Open(name string) (afero.File, error)

func (*SmbFs) OpenFile

func (s *SmbFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

func (*SmbFs) Remove

func (s *SmbFs) Remove(name string) error

func (*SmbFs) RemoveAll

func (s *SmbFs) RemoveAll(path string) error

func (*SmbFs) Rename

func (s *SmbFs) Rename(oldname, newname string) error

func (*SmbFs) Stat

func (s *SmbFs) Stat(name string) (os.FileInfo, error)

type SmbFsOption

type SmbFsOption struct {
	User     string
	Password string
}

Jump to

Keyboard shortcuts

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