Versions in this module Expand all Collapse all v0 v0.29.4 Apr 3, 2024 Changes in this version + const AwGoVersion + const DefaultLogPrefix + const DefaultMagicPrefix + const DefaultMaxLogSize + const DefaultMaxResults + const DefaultSessionName + const EnvVarAlfredBuild + const EnvVarAlfredVersion + const EnvVarBundleID + const EnvVarCacheDir + const EnvVarDataDir + const EnvVarDebug + const EnvVarLocalhash + const EnvVarName + const EnvVarPreferences + const EnvVarTheme + const EnvVarThemeBG + const EnvVarThemeSelectionBG + const EnvVarUID + const EnvVarVersion + const ModAlt + const ModCmd + const ModCtrl + const ModFn + const ModOpt + const ModShift + const TypeFile + const TypeText + const TypeURL + var IconAccount = &Icon + var IconBurn = &Icon + var IconClock = &Icon + var IconColor = &Icon + var IconColour = &Icon + var IconEject = &Icon + var IconError = &Icon + var IconFavorite = &Icon + var IconFavourite = &Icon + var IconGroup = &Icon + var IconHelp = &Icon + var IconHome = &Icon + var IconInfo = &Icon + var IconNetwork = &Icon + var IconNote = &Icon + var IconSettings = &Icon + var IconSwirl = &Icon + var IconSwitch = &Icon + var IconSync = &Icon + var IconTrash = &Icon + var IconUser = &Icon + var IconWarning = &Icon + var IconWeb = &Icon + var IconWorkflow = &Icon + func IsJobExists(err error) bool + func Marshal(v interface{}) ([]byte, error) + func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) + func NewSessionID() string + type Alfred struct + func NewAlfred(env ...Env) *Alfred + func (a *Alfred) Action(value ...string) error + func (a *Alfred) ActionAsType(typ string, value ...string) error + func (a *Alfred) Browse(path string) error + func (a *Alfred) ReloadWorkflow(bundleID ...string) error + func (a *Alfred) RunTrigger(name, query string, bundleID ...string) error + func (a *Alfred) Search(query string) error + func (a *Alfred) SetTheme(name string) error + type ArgVars struct + func NewArgVars() *ArgVars + func (a *ArgVars) Arg(s ...string) *ArgVars + func (a *ArgVars) MarshalJSON() ([]byte, error) + func (a *ArgVars) Send() error + func (a *ArgVars) String() (string, error) + func (a *ArgVars) Var(k, v string) *ArgVars + func (a *ArgVars) Vars() map[string]string + type Cache struct + Dir string + func NewCache(dir string) *Cache + func (c Cache) Age(name string) (time.Duration, error) + func (c Cache) Exists(name string) bool + func (c Cache) Expired(name string, maxAge time.Duration) bool + func (c Cache) Load(name string) ([]byte, error) + func (c Cache) LoadJSON(name string, v interface{}) error + func (c Cache) LoadOrStore(name string, maxAge time.Duration, reload func() ([]byte, error)) ([]byte, error) + func (c Cache) LoadOrStoreJSON(name string, maxAge time.Duration, reload func() (interface{}, error), ...) error + func (c Cache) Store(name string, data []byte) error + func (c Cache) StoreJSON(name string, v interface{}) error + type Config struct + func NewConfig(e ...Env) *Config + func (cfg *Config) Do() error + func (cfg *Config) From(v interface{}, opt ...env.DumpOption) error + func (cfg *Config) Get(key string, fallback ...string) string + func (cfg *Config) GetBool(key string, fallback ...bool) bool + func (cfg *Config) GetDuration(key string, fallback ...time.Duration) time.Duration + func (cfg *Config) GetFloat(key string, fallback ...float64) float64 + func (cfg *Config) GetInt(key string, fallback ...int) int + func (cfg *Config) GetString(key string, fallback ...string) string + func (cfg *Config) Set(key, value string, export bool, bundleID ...string) *Config + func (cfg *Config) To(v interface{}) error + func (cfg *Config) Unset(key string, bundleID ...string) *Config + type Env interface + Lookup func(key string) (string, bool) + type ErrJobExists struct + Name string + Pid int + func (err ErrJobExists) Error() string + func (err ErrJobExists) Is(target error) bool + type Feedback struct + Items []*Item + NoUIDs bool + func NewFeedback() *Feedback + func (fb *Feedback) Clear() + func (fb *Feedback) Filter(query string, opts ...fuzzy.Option) []*fuzzy.Result + func (fb *Feedback) IsEmpty() bool + func (fb *Feedback) Keywords(i int) string + func (fb *Feedback) Len() int + func (fb *Feedback) Less(i, j int) bool + func (fb *Feedback) MarshalJSON() ([]byte, error) + func (fb *Feedback) NewItem(title string) *Item + func (fb *Feedback) Rerun(secs float64) *Feedback + func (fb *Feedback) Send() error + func (fb *Feedback) Sort(query string, opts ...fuzzy.Option) []*fuzzy.Result + func (fb *Feedback) Swap(i, j int) + func (fb *Feedback) Var(k, v string) *Feedback + func (fb *Feedback) Vars() map[string]string + type Icon struct + Type IconType + Value string + type IconType string + const IconTypeFileIcon + const IconTypeFileType + const IconTypeImage + type Item struct + func (it *Item) Action(value ...string) *Item + func (it *Item) ActionForType(typ string, value ...string) *Item + func (it *Item) Alt() *Modifier + func (it *Item) Arg(s ...string) *Item + func (it *Item) Autocomplete(s string) *Item + func (it *Item) Cmd() *Modifier + func (it *Item) Copytext(s string) *Item + func (it *Item) Ctrl() *Modifier + func (it *Item) Fn() *Modifier + func (it *Item) Icon(icon *Icon) *Item + func (it *Item) IsFile(b bool) *Item + func (it *Item) Largetype(s string) *Item + func (it *Item) MarshalJSON() ([]byte, error) + func (it *Item) Match(s string) *Item + func (it *Item) NewModifier(key ...string) *Modifier + func (it *Item) Opt() *Modifier + func (it *Item) Quicklook(s string) *Item + func (it *Item) SetModifier(m *Modifier) + func (it *Item) Shift() *Modifier + func (it *Item) Subtitle(s string) *Item + func (it *Item) Title(s string) *Item + func (it *Item) UID(s string) *Item + func (it *Item) Valid(b bool) *Item + func (it *Item) Var(k, v string) *Item + func (it *Item) Vars() map[string]string + type MagicAction interface + Description func() string + Keyword func() string + Run func() error + RunText func() string + type Modifier struct + Key string + func (m *Modifier) Arg(s ...string) *Modifier + func (m *Modifier) Icon(i *Icon) *Modifier + func (m *Modifier) MarshalJSON() ([]byte, error) + func (m *Modifier) Subtitle(s string) *Modifier + func (m *Modifier) Valid(v bool) *Modifier + func (m *Modifier) Var(k, v string) *Modifier + func (m *Modifier) Vars() map[string]string + type Option func(wf *Workflow) Option + func AddMagic(actions ...MagicAction) Option + func HelpURL(url string) Option + func LogPrefix(prefix string) Option + func MagicPrefix(prefix string) Option + func MaxLogSize(bytes int) Option + func MaxResults(num int) Option + func RemoveMagic(actions ...MagicAction) Option + func SessionName(name string) Option + func SortOptions(opts ...fuzzy.Option) Option + func SuppressUIDs(on bool) Option + func TextErrors(on bool) Option + func Update(updater Updater) Option + type Session struct + SessionID string + func NewSession(dir, sessionID string) *Session + func (s Session) Clear(current bool) error + func (s Session) Exists(name string) bool + func (s Session) Load(name string) ([]byte, error) + func (s Session) LoadJSON(name string, v interface{}) error + func (s Session) LoadOrStore(name string, reload func() ([]byte, error)) ([]byte, error) + func (s Session) LoadOrStoreJSON(name string, reload func() (interface{}, error), v interface{}) error + func (s Session) Store(name string, data []byte) error + func (s Session) StoreJSON(name string, v interface{}) error + type Updater interface + CheckDue func() bool + CheckForUpdate func() error + Install func() error + UpdateAvailable func() bool + type Workflow struct + Alfred *Alfred + Cache *Cache + Config *Config + Data *Cache + Feedback *Feedback + Keychain *keychain.Keychain + Session *Session + Updater Updater + func New(opts ...Option) *Workflow + func NewFromEnv(env Env, opts ...Option) *Workflow + func (wf *Workflow) Args() []string + func (wf *Workflow) BundleID() string + func (wf *Workflow) CacheDir() string + func (wf *Workflow) CheckForUpdate() error + func (wf *Workflow) ClearCache() error + func (wf *Workflow) ClearData() error + func (wf *Workflow) Configure(opts ...Option) (previous Option) + func (wf *Workflow) DataDir() string + func (wf *Workflow) Debug() bool + func (wf *Workflow) Dir() string + func (wf *Workflow) Fatal(msg string) + func (wf *Workflow) FatalError(err error) + func (wf *Workflow) Fatalf(format string, args ...interface{}) + func (wf *Workflow) Filter(query string) []*fuzzy.Result + func (wf *Workflow) InstallUpdate() error + func (wf *Workflow) IsEmpty() bool + func (wf *Workflow) IsRunning(jobName string) bool + func (wf *Workflow) Kill(jobName string) error + func (wf *Workflow) LogFile() string + func (wf *Workflow) Name() string + func (wf *Workflow) NewFileItem(path string) *Item + func (wf *Workflow) NewItem(title string) *Item + func (wf *Workflow) NewWarningItem(title, subtitle string) *Item + func (wf *Workflow) OpenCache() error + func (wf *Workflow) OpenData() error + func (wf *Workflow) OpenHelp() error + func (wf *Workflow) OpenLog() error + func (wf *Workflow) Rerun(secs float64) *Workflow + func (wf *Workflow) Reset() error + func (wf *Workflow) Run(fn func()) + func (wf *Workflow) RunInBackground(jobName string, cmd *exec.Cmd) error + func (wf *Workflow) SendFeedback() *Workflow + func (wf *Workflow) SessionID() string + func (wf *Workflow) UpdateAvailable() bool + func (wf *Workflow) UpdateCheckDue() bool + func (wf *Workflow) Var(k, v string) *Workflow + func (wf *Workflow) Vars() map[string]string + func (wf *Workflow) Version() string + func (wf *Workflow) Warn(title, subtitle string) *Workflow + func (wf *Workflow) WarnEmpty(title, subtitle string)