web

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Spacer = " "

Variables

View Source
var Config = ConfigPath{
	domain.Alfred: "preferences/features/websearch/prefs.plist",
	domain.Albert: "org.albert.extension.websearch/engines.json",
}

Functions

This section is empty.

Types

type AlbertSites

type AlbertSites []*SiteConfig

func (*AlbertSites) Convert

func (a *AlbertSites) Convert(dict ConfigDict) AlbertSites

func (*AlbertSites) Decode

func (a *AlbertSites) Decode(r io.ReadSeeker) error

func (*AlbertSites) Encode

func (a *AlbertSites) Encode(dict ConfigDict) ([]byte, error)

type AlfredSites

type AlfredSites struct {
	CustomSites `plist:"customSites"`
}

func (*AlfredSites) Convert

func (a *AlfredSites) Convert(dict ConfigDict) AlfredSites

func (*AlfredSites) Decode

func (a *AlfredSites) Decode(r io.ReadSeeker) error

func (*AlfredSites) Encode

func (a *AlfredSites) Encode(dict ConfigDict) ([]byte, error)

type ConfigDict

type ConfigDict map[Id]*SiteConfig

func (ConfigDict) String

func (d ConfigDict) String() string

type ConfigPath

type ConfigPath map[domain.Type]string

func (ConfigPath) Path

func (c ConfigPath) Path(p domain.Type) string

type CustomSites

type CustomSites map[string]*SiteConfig

type Id

type Id [sha1.Size]byte

type Launcher

type Launcher struct {
	Type       domain.Type
	BasePath   string
	ConfigPath string
	FileInfo   os.FileInfo
	*AlfredSites
	AlbertSites
}

func (*Launcher) Init

func (l *Launcher) Init()

func (*Launcher) Load

func (l *Launcher) Load() error

func (*Launcher) Mtime

func (l *Launcher) Mtime() time.Time

func (*Launcher) Parse

func (l *Launcher) Parse() error

func (*Launcher) Populate

func (l *Launcher) Populate(dict ConfigDict)

func (*Launcher) Save

func (l *Launcher) Save(dict ConfigDict) error

type Option

type Option struct {
	DtyRun  bool
	Verbose bool
}

type Pair

type Pair [2]*Launcher

func (*Pair) Len

func (p *Pair) Len() int

func (*Pair) Less

func (p *Pair) Less(i, j int) bool

func (*Pair) Load

func (p *Pair) Load() error

func (*Pair) Merge

func (p *Pair) Merge(dict ConfigDict)

func (*Pair) Save

func (p *Pair) Save(dict ConfigDict) error

func (*Pair) Swap

func (p *Pair) Swap(i, j int)

type SiteConfig

type SiteConfig struct {
	Uuid     string `plist:"uuid,omitempty" json:"-"`
	Enabled  bool   `plist:"enabled" json:"-"`
	Utf8     bool   `plist:"utf8" json:"-"`
	Trigger  string `plist:"keyword" json:"trigger"`
	Name     string `plist:"text" json:"name"`
	Url      string `plist:"url" json:"url"`
	IconPath string `plist:"-" json:"iconPath"`
}

func (*SiteConfig) Albert

func (a *SiteConfig) Albert()

func (*SiteConfig) Alfred

func (a *SiteConfig) Alfred()

func (*SiteConfig) Id

func (a *SiteConfig) Id() Id

func (*SiteConfig) Normalize

func (a *SiteConfig) Normalize()

func (*SiteConfig) PreserveUuid

func (a *SiteConfig) PreserveUuid(key string)

type Web

type Web struct {
	Launchers *Pair
	ConfigDict
	Out    io.Writer
	ErrOut io.Writer
	// contains filtered or unexported fields
}

func (*Web) Sync

func (w *Web) Sync(option Option) error

Jump to

Keyboard shortcuts

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