go-finder: github.com/b4b4r07/go-finder Index | Files | Directories

package finder

import "github.com/b4b4r07/go-finder"

Index

Package Files

finder.go fzf.go fzy.go peco.go

Variables

var DefaultCommands = Commands{

    Command{
        Name: "fzf",
        Args: []string{"--reverse", "--height=50%", "--ansi", "--multi"},
    },

    Command{Name: "fzy"},

    Command{Name: "peco"},

    Command{Name: "percol"},
}

DefaultCommands represents the list of default finder commands optimized for quick usage

type CLI Uses

type CLI interface {
    Run() ([]string, error)
    Read(source.Source)
}

CLI is the command having a command-line interface

type Command Uses

type Command struct {
    Name   string
    Args   []string
    Path   string
    Items  Items
    Source source.Source
}

Command represents the command

func (*Command) Install Uses

func (c *Command) Install(path string) error

Install does nothing and is implemented to satisfy Finder interface This method should be overwritten by each finder command implementation

func (*Command) Read Uses

func (c *Command) Read(data source.Source)

Read sets the data sources

func (*Command) Run Uses

func (c *Command) Run() ([]string, error)

Run runs as a command

func (*Command) Select Uses

func (c *Command) Select(args interface{}) ([]interface{}, error)

Select selects the keys in various map

type Commands Uses

type Commands []Command

Commands represents the command list

func (Commands) Lookup Uses

func (c Commands) Lookup() (Command, error)

Lookup lookups the available command

type Finder Uses

type Finder interface {
    CLI
    Install(string) error
    Select(interface{}) ([]interface{}, error)
}

Finder is the interface of a filter command

func New Uses

func New(args ...string) (Finder, error)

New creates Finder instance

type Fzf Uses

type Fzf struct {
    *Command
}

Fzf represents the filter instance

func (Fzf) Install Uses

func (c Fzf) Install(path string) error

Install installs the command

type Fzy Uses

type Fzy struct {
    *Command
}

Fzy represents the filter instance

func (Fzy) Install Uses

func (c Fzy) Install(path string) error

Install installs the command

type Item Uses

type Item struct {
    Key   string
    Value interface{}
}

Item is key-value

type Items Uses

type Items []Item

Items is the collection of Item

func NewItems Uses

func NewItems() Items

NewItems creates Items object

func (*Items) Add Uses

func (i *Items) Add(key string, value interface{})

Add addes item to Items

type Peco Uses

type Peco struct {
    *Command
}

Peco represents the filter instance

func (Peco) Install Uses

func (c Peco) Install(path string) error

Install installs the command

Directories

PathSynopsis
_example
installer
source

Package finder imports 9 packages (graph) and is imported by 1 packages. Updated 2018-11-14. Refresh now. Tools for package owners.