web

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Spacer = " "

Variables

View Source
var Config = domain.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) Sites

func (*AlbertSites) Decode

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

func (*AlbertSites) Encode

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

func (*AlbertSites) List added in v0.2.0

func (a *AlbertSites) List() []*SiteConfig

func (*AlbertSites) Populate added in v0.2.0

func (a *AlbertSites) Populate(dict ConfigDict)

type AlfredSites

type AlfredSites struct {
	CustomSites `plist:"customSites"`
	// contains filtered or unexported fields
}

func (*AlfredSites) Convert

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

func (*AlfredSites) Decode

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

func (*AlfredSites) Encode

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

func (*AlfredSites) List added in v0.2.0

func (a *AlfredSites) List() []*SiteConfig

func (*AlfredSites) Populate added in v0.2.0

func (a *AlfredSites) Populate(dict ConfigDict)

type ConfigDict

type ConfigDict map[Id]*SiteConfig

func (ConfigDict) String

func (d ConfigDict) String() string

type CustomSites

type CustomSites map[string]*SiteConfig

type Diff added in v0.2.0

type Diff map[Id]Order

type Id

type Id [sha1.Size]byte

type Launcher

type Launcher struct {
	Type       domain.Type
	BasePath   string
	ConfigPath string
	FileInfo   os.FileInfo
	Sites      Sites
}

func (*Launcher) Diff added in v0.2.0

func (l *Launcher) Diff(diff Diff)

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 {
	DryRun  bool
	Verbose bool
}

type Order added in v0.2.0

type Order []domain.Type

func (Order) String added in v0.2.0

func (o Order) String() string

type Pair

type Pair [2]*Launcher

func (*Pair) Diff added in v0.2.0

func (p *Pair) Diff(dict ConfigDict) string

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 (s *SiteConfig) Albert()

func (*SiteConfig) Alfred

func (s *SiteConfig) Alfred()

func (*SiteConfig) Id

func (s *SiteConfig) Id() Id

func (*SiteConfig) Normalize

func (s *SiteConfig) Normalize()

func (*SiteConfig) PreserveUuid

func (s *SiteConfig) PreserveUuid(key string)

type Sites added in v0.2.0

type Sites interface {
	List() []*SiteConfig
	Decode(io.ReadSeeker) error
	Encode(ConfigDict) ([]byte, error)
	Populate(ConfigDict)
	Convert(ConfigDict) Sites
}

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