Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventType ¶
type EventType int
const ( EVENT_TYPE_ADDED EventType = (1 << iota) EVENT_TYPE_REMOVED EVENT_TYPE_RENAMED EVENT_TYPE_CHANGED EVENT_TYPE_NONE EventType = 0 EVENT_TYPE_MIN = EVENT_TYPE_ADDED EVENT_TYPE_MAX = EVENT_TYPE_CHANGED )
func (EventType) FlagString ¶
type File ¶
type File struct {
Index string `sqlite:"index,primary" json:"index"`
Path string `sqlite:"path,primary" json:"path"`
Name string `sqlite:"name,primary" json:"name"`
IsDir bool `sqlite:"is_dir,not null" json:"is_dir"`
Ext string `sqlite:"ext" json:"ext"`
ModTime time.Time `sqlite:"modtime" json:"modtime"`
Size int64 `sqlite:"size,not null" json:"size"`
}
func NewFile ¶
func NewFile(evt IndexerEvent, write bool) *File
NewFile creates a file object from an event
type FileMark ¶
type FileMark struct {
Index string `sqlite:"index,primary,foreign"`
Path string `sqlite:"path,primary,foreign"`
Name string `sqlite:"name,primary,foreign"`
Mark bool `sqlite:"mark,not null"`
IndexTime time.Time `sqlite:"idxtime"`
}
func NewFileMark ¶
NewFileMark creates an empty filemark object
type Indexer ¶
func NewIndexer ¶
type IndexerEvent ¶
type IndexerState ¶
type IndexerState uint
const ( IndexerStateIdle IndexerState = iota IndexerStateReindexing IndexerStateRunning IndexerStateSuspended )
func (IndexerState) String ¶
func (v IndexerState) String() string
type Manager ¶
type Manager struct {
SQObjects
// contains filtered or unexported fields
}
func NewManager ¶
Create a new index manager object with a sqlite connection. Add SQLITE_FLAG_DELETEIFEXISTS to clear out existing tables
func (*Manager) Exclude ¶
Exclude adds a path or file extension exclusion to an index, removing any existing files which match these exclusions. If the exclusion begins with a '.' then a file extension exlusion is added, if it begins with a '/' then a path prefix exclusion is added. Path prefix exclusions are case-sensitive, file extension exclusions are not.
func (*Manager) NewIndexer ¶
NewIndexer adds a file indexer and initiates walking the file tree
type RenderFunc ¶
type RenderFunc func(context.Context, IndexerEvent) error
Click to show internal directories.
Click to hide internal directories.