util

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir

func CacheDir() string

func ConfigDir

func ConfigDir() string

func FileExists added in v0.5.0

func FileExists(filename string) bool

func FromGob added in v0.0.41

func FromGob[T any](src string, dest *T) bool

func FromJson

func FromJson[T any](src string, dest *T) bool

func FuzzyScore added in v0.0.50

func FuzzyScore(input, target string) float64

func ThemeDir added in v0.6.0

func ThemeDir() string

func TmpDir

func TmpDir() string

func ToGob added in v0.0.41

func ToGob[T any](val *T, dest string)

func ToJson

func ToJson[T any](src *T, dest string)

Types

type Entry added in v0.5.2

type Entry struct {
	Categories       []string     `mapstructure:"categories,omitempty" json:"categories,omitempty"`
	Class            string       `mapstructure:"class,omitempty" json:"class,omitempty"`
	DragDrop         bool         `mapstructure:"drag_drop,omitempty" json:"drag_drop,omitempty"`
	DragDropData     string       `mapstructure:"drag_drop_data,omitempty" json:"drag_drop_data,omitempty"`
	Exec             string       `mapstructure:"exec,omitempty" json:"exec,omitempty"`
	ExecAlt          string       `mapstructure:"exec_alt,omitempty" json:"exec_alt,omitempty"`
	HideText         bool         `mapstructure:"hide_text,omitempty" json:"hide_text,omitempty"`
	Icon             string       `mapstructure:"icon,omitempty" json:"icon,omitempty"`
	Image            string       `mapstructure:"image,omitempty" json:"image,omitempty"`
	InitialClass     string       `mapstructure:"initial_class,omitempty" json:"initial_class,omitempty"`
	Label            string       `mapstructure:"label,omitempty" json:"label,omitempty"`
	MatchFields      int          `mapstructure:"match_fields,omitempty" json:"match_fields,omitempty"`
	Matching         MatchingType `mapstructure:"matching,omitempty" json:"matching,omitempty"`
	Path             string       `mapstructure:"path,omitempty" json:"path,omitempty"`
	RecalculateScore bool         `mapstructure:"recalculate_score,omitempty" json:"recalculate_score,omitempty"`
	ScoreFinal       float64      `mapstructure:"score_final,omitempty" json:"score_final,omitempty"`
	ScoreFuzzy       float64      `mapstructure:"score_fuzzy,omitempty" json:"score_fuzzy,omitempty"`
	Searchable       string       `mapstructure:"searchable,omitempty" json:"searchable,omitempty"`
	Sub              string       `mapstructure:"sub,omitempty" json:"sub,omitempty"`
	Terminal         bool         `mapstructure:"terminal,omitempty" json:"terminal,omitempty"`
	Prefer           bool         `mapstructure:"prefer,omitempty" json:"prefer,omitempty"`

	// internal
	DaysSinceUsed   int                       `mapstructure:"-"`
	History         bool                      `mapstructure:"-"`
	LastUsed        time.Time                 `mapstructure:"-"`
	Module          string                    `mapstructure:"-"`
	OpenWindows     uint                      `mapstructure:"-"`
	Piped           Piped                     `mapstructure:"-"`
	PipedAlt        Piped                     `mapstructure:"-"`
	SpecialFunc     func(args ...interface{}) `mapstructure:"-"`
	SpecialFuncArgs []interface{}             `mapstructure:"-"`
	Used            int                       `mapstructure:"-"`
}

func (Entry) Identifier added in v0.5.2

func (e Entry) Identifier() string

type MatchingType added in v0.3.6

type MatchingType int
const (
	Fuzzy MatchingType = iota
	AlwaysTop
	AlwaysBottom
	AlwaysTopOnEmptySearch
)

type Piped added in v0.5.2

type Piped struct {
	Content string `mapstructure:"content,omitempty"`
	Type    string `mapstructure:"type,omitempty"`
}

Jump to

Keyboard shortcuts

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