config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BINDING_FOUND = iota
	BINDING_INCOMPLETE
	BINDING_NOT_FOUND
)
View Source
const (
	FILTER_MIMETYPE = iota
	FILTER_HEADER
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountConfig

type AccountConfig struct {
	CopyTo          string
	Default         string
	From            string
	Name            string
	Source          string
	SourceCredCmd   string
	Folders         []string
	Params          map[string]string
	Outgoing        string
	OutgoingCredCmd string
}

type AercConfig

type AercConfig struct {
	Bindings BindingConfig
	Compose  ComposeConfig
	Ini      *ini.File       `ini:"-"`
	Accounts []AccountConfig `ini:"-"`
	Filters  []FilterConfig  `ini:"-"`
	Viewer   ViewerConfig    `ini:"-"`
	Ui       UIConfig
}

func LoadConfig

func LoadConfig(root *string, sharedir string) (*AercConfig, error)

type Binding

type Binding struct {
	Output []KeyStroke
	Input  []KeyStroke
}

func ParseBinding

func ParseBinding(input, output string) (*Binding, error)

type BindingConfig

type BindingConfig struct {
	Global        *KeyBindings
	AccountWizard *KeyBindings
	Compose       *KeyBindings
	ComposeEditor *KeyBindings
	ComposeReview *KeyBindings
	MessageList   *KeyBindings
	MessageView   *KeyBindings
	Terminal      *KeyBindings
}

type BindingSearchResult

type BindingSearchResult int

type ComposeConfig

type ComposeConfig struct {
	Editor string `ini:"editor"`
}

type FilterConfig

type FilterConfig struct {
	FilterType int
	Filter     string
	Command    string
	Header     string
	Regex      *regexp.Regexp
}

type KeyBindings

type KeyBindings struct {

	// If false, disable global keybindings in this context
	Globals bool
	// Which key opens the ex line (default is :)
	ExKey KeyStroke
	// contains filtered or unexported fields
}

func MergeBindings

func MergeBindings(bindings ...*KeyBindings) *KeyBindings

func NewKeyBindings

func NewKeyBindings() *KeyBindings

func (*KeyBindings) Add

func (bindings *KeyBindings) Add(binding *Binding)

func (*KeyBindings) GetBinding

func (bindings *KeyBindings) GetBinding(
	input []KeyStroke) (BindingSearchResult, []KeyStroke)

type KeyStroke

type KeyStroke struct {
	Key  tcell.Key
	Rune rune
}

func ParseKeyStrokes

func ParseKeyStrokes(keystrokes string) ([]KeyStroke, error)

type UIConfig

type UIConfig struct {
	IndexFormat       string   `ini:"index-format"`
	TimestampFormat   string   `ini:"timestamp-format"`
	ShowHeaders       []string `delim:","`
	RenderAccountTabs string   `ini:"render-account-tabs"`
	SidebarWidth      int      `ini:"sidebar-width"`
	PreviewHeight     int      `ini:"preview-height"`
	EmptyMessage      string   `ini:"empty-message"`
}

type ViewerConfig

type ViewerConfig struct {
	Pager        string
	Alternatives []string
}

Jump to

Keyboard shortcuts

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