config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConfigPath

func GetDefaultConfigPath() string

Types

type Config

type Config struct {
	IndexPath      string      `toml:"index_path"`
	ListenAddr     string      `toml:"listen_addr"`
	MaxFileBytes   int64       `toml:"max_file_bytes"`
	WorkerCount    int         `toml:"worker_count"`
	IndexPaths     []IndexPath `toml:"index_paths"`
	TextExts       []string    `toml:"text_extensions"`
	IndexAllFiles  bool        `toml:"index_all_files"`
	IndexXattrTags bool        `toml:"index_xattr_tags"`

	RootDir       string   `toml:"root_dir,omitempty"`
	MaxDepth      int      `toml:"max_depth,omitempty"`
	ExcludeHidden bool     `toml:"exclude_hidden,omitempty"`
	ExcludeDirs   []string `toml:"exclude_dirs,omitempty"`
	// contains filtered or unexported fields
}

func Default

func Default() *Config

func Load

func Load(path string) (*Config, error)

func (*Config) BuildMaps

func (c *Config) BuildMaps()

func (*Config) ExclusionReason added in v0.2.0

func (c *Config) ExclusionReason(path string) string

func (*Config) FindIndexPath added in v0.2.0

func (c *Config) FindIndexPath(path string) *IndexPath

func (*Config) GetDepth

func (c *Config) GetDepth(path string) int

func (*Config) GetMaxDepth

func (c *Config) GetMaxDepth(path string) int

func (*Config) IsTextFile

func (c *Config) IsTextFile(path string) bool

func (*Config) Save

func (c *Config) Save(path string) error

func (*Config) ShouldIndexDir

func (c *Config) ShouldIndexDir(path string) bool

func (*Config) ShouldIndexFile

func (c *Config) ShouldIndexFile(path string) bool

type IndexPath

type IndexPath struct {
	Path             string   `toml:"path"`
	MaxDepth         int      `toml:"max_depth"`
	ExcludeHidden    bool     `toml:"exclude_hidden"`
	ExcludeDirs      []string `toml:"exclude_dirs"`
	ExtractExif      bool     `toml:"extract_exif"`
	ExtractXattrTags bool     `toml:"extract_xattr_tags"`
	Watch            *bool    `toml:"watch,omitempty"` // nil = true (default), false = skip fsnotify
	// contains filtered or unexported fields
}

func (*IndexPath) ShouldWatch added in v0.1.0

func (ip *IndexPath) ShouldWatch() bool

type IndexStats

type IndexStats struct {
	TotalFiles    int       `json:"total_files"`
	TotalBytes    int64     `json:"total_bytes"`
	LastIndexTime time.Time `json:"last_index_time"`
	IndexDuration string    `json:"index_duration"`
}

Jump to

Keyboard shortcuts

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