Documentation ¶
Index ¶
- Variables
- func ExpandPath(path string) (string, error)
- func Fprint(out io.Writer, printer Printer, results []Result) error
- func Print(printer Printer, results []Result) error
- type App
- func (app *App) ClearTag()
- func (app *App) FindSlashCommandDefinition(category, name string) (SlashCommandDefinition, error)
- func (app *App) GetTag() string
- func (app *App) RegisterSlashCommandDefinition(d SlashCommandDefinition) error
- func (app *App) Run()
- func (app *App) RunCmd(query string, args ...string) (results []Result, err error)
- func (app *App) SetPrinterByName(name string) error
- func (app *App) SetTag(tag string)
- func (app *App) SlashCommandCategories() []string
- func (app *App) SlashCommandNames(category string) []string
- type Conf
- type ConfMdq
- type ConfMdqi
- type HorizontalPrinter
- type Printer
- type Result
- type SlashCommand
- type SlashCommandDefinition
- type VerticalPrinter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSlashCommandNotFound = errors.New("unknown SlashCommand") ErrNotASlashCommand = errors.New("there are no SlashCommand") ErrSlashCommandInvalidArgs = errors.New("invalid args") ErrUnknownPrinterName = errors.New("unknown printer name") )
View Source
var Debug = func() *log.Logger { var out io.Writer if os.Getenv("DEBUG") != "" { out = os.Stderr } else { out = ioutil.Discard } l := log.New(out, "[debug] ", log.Ldate|log.Ltime|log.Lshortfile) return l }()
View Source
var DefaultOutput io.Writer
View Source
var Logger = func() *log.Logger { return log.New(os.Stderr, "", log.Ldate|log.Ltime) }()
View Source
var Version string
Functions ¶
func ExpandPath ¶ added in v0.0.3
ExpandPath expands file path like `~/path/to/foo`
Types ¶
type App ¶
type App struct { // Alive turns into false, mdqi will exit. Alive bool // Printer prints results. Printer Printer // contains filtered or unexported fields }
func (*App) FindSlashCommandDefinition ¶
func (app *App) FindSlashCommandDefinition(category, name string) (SlashCommandDefinition, error)
func (*App) RegisterSlashCommandDefinition ¶
func (app *App) RegisterSlashCommandDefinition(d SlashCommandDefinition) error
func (*App) SetPrinterByName ¶
func (*App) SlashCommandCategories ¶ added in v0.0.3
func (*App) SlashCommandNames ¶ added in v0.0.3
type Conf ¶
type Conf struct { // Mdq contains configurations about mdq. Mdq ConfMdq `yaml:"mdq"` // Mdqi contains configurations about mdqi. Mdqi ConfMdqi `yaml:"mdqi"` }
func ConfFromFile ¶
type ConfMdqi ¶
type ConfMdqi struct { // History is the path to history file. // Default value is "$HOME/.mdqi_history". History string `yaml:"history"` // DefaultTag is default value for mdq's --tag option. DefaultTag string `yaml:"default_tag"` // DefaultDisplay is default value for mdqi's /display command. DefaultDisplay string `yaml:"default_display"` }
type HorizontalPrinter ¶
type HorizontalPrinter struct{}
func (HorizontalPrinter) Name ¶
func (p HorizontalPrinter) Name() string
type SlashCommand ¶
func ParseSlashCommand ¶
func ParseSlashCommand(query string) (*SlashCommand, error)
type SlashCommandDefinition ¶
type VerticalPrinter ¶
type VerticalPrinter struct{}
func (VerticalPrinter) Name ¶
func (p VerticalPrinter) Name() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.