config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppleScript added in v0.0.3

type AppleScript struct {
	Cache  bool         `yaml:"cache" structs:"cachescript"`
	Script ScriptConfig `yaml:"script" structs:"-"`
}

AppleScript is an Alfred action that runs NSAppleScript

func (AppleScript) ToWorkflowConfig added in v0.0.3

func (a AppleScript) ToWorkflowConfig() map[string]interface{}

func (*AppleScript) UnmarshalYAML added in v1.1.1

func (a *AppleScript) UnmarshalYAML(node *yaml.Node) error

type Clipboard added in v0.0.2

type Clipboard struct {
	Text string `yaml:"text" structs:"clipboardtext"`
}

Clipboard is an object that copies to the clipboard

func (Clipboard) ToWorkflowConfig added in v0.0.2

func (c Clipboard) ToWorkflowConfig() map[string]interface{}

func (*Clipboard) UnmarshalYAML added in v1.1.1

func (c *Clipboard) UnmarshalYAML(node *yaml.Node) error

type Config

type Config struct {
	Author      string
	BundleID    string            `yaml:"bundle-id"`
	Description string            `yaml:"description"`
	Icon        string            `yaml:"icon"`
	Name        string            `yaml:"name"`
	Objects     ObjectMap         `yaml:"objects"`
	Readme      string            `yaml:"readme"`
	URL         string            `yaml:"url"`
	Variables   map[string]string `yaml:"variables"`
	Version     string            `yaml:"version"`
}

Config is a parsed alpaca.json file.

func Read

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

Read parses an alpaca.json file.

type Keyword added in v0.0.2

type Keyword struct {
	Keyword   string              `yaml:"keyword" structs:"keyword"`
	WithSpace bool                `yaml:"with-space" structs:"withspace"`
	Title     string              `yaml:"title" structs:"text"`
	Subtitle  string              `yaml:"subtitle" structs:"subtext"`
	Argument  keywordArgumentType `yaml:"argument" structs:"argumenttype"`
}

Keyword is an object triggered by a keyword

func (Keyword) ToWorkflowConfig added in v0.0.2

func (k Keyword) ToWorkflowConfig() map[string]interface{}

type Object

type Object struct {
	Name    string       `yaml:"-" structs:"-"`
	Icon    string       `yaml:"icon" structs:"-"`
	Type    ObjectType   `yaml:"type" structs:"-"`
	UID     string       `yaml:"-" structs:"uid"`
	Then    ThenList     `yaml:"then" structs:"-"`
	Version int64        `yaml:"version" structs:"version"`
	Config  ObjectConfig `yaml:"config" structs:"-"`
}

Object is an object in an Alfred workflow

func (Object) ToWorkflowConfig added in v0.0.2

func (o Object) ToWorkflowConfig() map[string]interface{}

func (*Object) UnmarshalYAML added in v0.0.2

func (o *Object) UnmarshalYAML(node *yaml.Node) error

type ObjectConfig added in v0.0.2

type ObjectConfig interface {
	ToWorkflowConfig() map[string]interface{}
}

ObjectConfig is a general configuration for an object

type ObjectMap

type ObjectMap map[string]Object

ObjectMap is a mapping of object names to objects

func (*ObjectMap) UnmarshalYAML

func (o *ObjectMap) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML unmarshals an object.

type ObjectType added in v0.0.2

type ObjectType string

ObjectType denotes the general behavior of an Alfred object

var (
	AppleScriptType  ObjectType = "applescript"
	ClipboardType    ObjectType = "clipboard"
	KeywordType      ObjectType = "keyword"
	OpenURLType      ObjectType = "open-url"
	ScriptType       ObjectType = "script"
	ScriptFilterType ObjectType = "script-filter"
	UnknownType      ObjectType = "unknown"
)

type OpenURL added in v0.0.2

type OpenURL struct {
	URL string `yaml:"url" structs:"url"`
}

OpenURL is an object that opens a URL in a browser

func (OpenURL) ToWorkflowConfig added in v0.0.2

func (o OpenURL) ToWorkflowConfig() map[string]interface{}

type Script

type Script struct {
	Script ScriptConfig
}

Script is an Alfred action that runs a script

func (Script) ToWorkflowConfig added in v0.0.2

func (s Script) ToWorkflowConfig() map[string]interface{}

type ScriptConfig added in v0.0.2

type ScriptConfig struct {
	ArgType string `yaml:"arg-type" structs"-"`
	Content string `yaml:"content" structs:"script"`
	Path    string `yaml:"path" structs:"scriptfile"`
	Type    string `yaml:"type" structs:"-"`
}

ScriptConfig is a runnable script in a workflow.

func (ScriptConfig) ToWorkflowConfig added in v0.0.2

func (s ScriptConfig) ToWorkflowConfig() map[string]interface{}

type ScriptFilter added in v0.0.2

type ScriptFilter struct {
	Argument            keywordArgumentType `yaml:"argument" structs:"argumenttype"`
	ArgumentTrim        string              `yaml:"argument-trim" structs:"-"`
	Escaping            []string            `yaml:"escaping" structs:"-"`
	IgnoreEmptyArgument bool                `yaml:"ignore-empty-argument" structs:"-"`
	Keyword             string              `yaml:"keyword" structs:"keyword"`
	RunningSubtitle     string              `yaml:"running-subtitle" structs:"runningsubtext"`
	Subtitle            string              `yaml:"subtitle" structs:"subtext"`
	Title               string              `yaml:"title" structs:"title"`
	WithSpace           bool                `yaml:"with-space" structs:"withspace"`
	Script              ScriptConfig        `yaml:"script" structs:"-"`
	AlfredFilters       *struct {
		Mode string `yaml:"mode"`
	} `yaml:"alfred-filters-results" structs:"-"`
	RunBehavior *struct {
		Immediate  bool   `yaml:"immediate"`
		QueueMode  string `yaml:"queue-mode"`
		QueueDelay string `yaml:"queue-delay"`
	} `yaml:"run-behavior" structs:"-"`
}

ScriptFilter is an Alfred filter that runs a script

func (ScriptFilter) ToWorkflowConfig added in v0.0.2

func (s ScriptFilter) ToWorkflowConfig() map[string]interface{}

type Then

type Then struct {
	Object string `yaml:"object"`
}

Then is an object following another object.

func (*Then) UnmarshalYAML added in v1.1.1

func (t *Then) UnmarshalYAML(node *yaml.Node) error

type ThenList added in v1.1.1

type ThenList []Then

ThenList is a list of Then structs

func (*ThenList) UnmarshalYAML added in v1.1.1

func (l *ThenList) UnmarshalYAML(node *yaml.Node) error

Jump to

Keyboard shortcuts

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