jid: github.com/simeji/jid Index | Files

package jid

import "github.com/simeji/jid"

Index

Package Files

engine.go json_manager.go query.go suggestion.go terminal.go

Constants

const (
    DefaultY     int    = 1
    FilterPrompt string = "[Filter]> "
)

type Engine Uses

type Engine struct {
    // contains filtered or unexported fields
}

func (*Engine) GetQuery Uses

func (e *Engine) GetQuery() QueryInterface

func (*Engine) Run Uses

func (e *Engine) Run() EngineResultInterface

type EngineAttribute Uses

type EngineAttribute struct {
    DefaultQuery string
    Monochrome   bool
    PrettyResult bool
}

type EngineInterface Uses

type EngineInterface interface {
    Run() EngineResultInterface
    GetQuery() QueryInterface
}

func NewEngine Uses

func NewEngine(s io.Reader, ea *EngineAttribute) (EngineInterface, error)

type EngineResult Uses

type EngineResult struct {
    // contains filtered or unexported fields
}

func (*EngineResult) GetContent Uses

func (er *EngineResult) GetContent() string

func (*EngineResult) GetError Uses

func (er *EngineResult) GetError() error

func (*EngineResult) GetQueryString Uses

func (er *EngineResult) GetQueryString() string

type EngineResultInterface Uses

type EngineResultInterface interface {
    GetQueryString() string
    GetContent() string
    GetError() error
}

type JsonManager Uses

type JsonManager struct {
    // contains filtered or unexported fields
}

func NewJsonManager Uses

func NewJsonManager(reader io.Reader) (*JsonManager, error)

func (*JsonManager) Get Uses

func (jm *JsonManager) Get(q QueryInterface, confirm bool) (string, []string, []string, error)

func (*JsonManager) GetCandidateKeys Uses

func (jm *JsonManager) GetCandidateKeys(q QueryInterface) []string

func (*JsonManager) GetFilteredData Uses

func (jm *JsonManager) GetFilteredData(q QueryInterface, confirm bool) (*simplejson.Json, []string, []string, error)

func (*JsonManager) GetPretty Uses

func (jm *JsonManager) GetPretty(q QueryInterface, confirm bool) (string, []string, []string, error)

type Query Uses

type Query struct {
    // contains filtered or unexported fields
}

func NewQuery Uses

func NewQuery(query []rune) *Query

func NewQueryWithString Uses

func NewQueryWithString(query string) *Query

func (*Query) Add Uses

func (q *Query) Add(query []rune) []rune

func (*Query) Clear Uses

func (q *Query) Clear() []rune

func (*Query) Delete Uses

func (q *Query) Delete(i int) []rune

func (*Query) Get Uses

func (q *Query) Get() []rune

func (*Query) GetChar Uses

func (q *Query) GetChar(idx int) rune

func (*Query) GetKeywords Uses

func (q *Query) GetKeywords() [][]rune

func (*Query) GetLastKeyword Uses

func (q *Query) GetLastKeyword() []rune

func (*Query) IndexOffset Uses

func (q *Query) IndexOffset(i int) int

func (*Query) Insert Uses

func (q *Query) Insert(query []rune, idx int) []rune

func (*Query) Length Uses

func (q *Query) Length() int

func (*Query) PopKeyword Uses

func (q *Query) PopKeyword() ([]rune, []rune)

func (*Query) Set Uses

func (q *Query) Set(query []rune) []rune

func (*Query) StringAdd Uses

func (q *Query) StringAdd(query string) string

func (*Query) StringGet Uses

func (q *Query) StringGet() string

func (*Query) StringGetKeywords Uses

func (q *Query) StringGetKeywords() []string

func (*Query) StringGetLastKeyword Uses

func (q *Query) StringGetLastKeyword() string

func (*Query) StringInsert Uses

func (q *Query) StringInsert(query string, idx int) string

func (*Query) StringPopKeyword Uses

func (q *Query) StringPopKeyword() (string, []rune)

func (*Query) StringSet Uses

func (q *Query) StringSet(query string) string

type QueryInterface Uses

type QueryInterface interface {
    Get() []rune
    Set(query []rune) []rune
    Insert(query []rune, idx int) []rune
    Add(query []rune) []rune
    Delete(i int) []rune
    Clear() []rune
    Length() int
    IndexOffset(int) int
    GetChar(int) rune
    GetKeywords() [][]rune
    GetLastKeyword() []rune
    PopKeyword() ([]rune, []rune)
    StringGet() string
    StringSet(query string) string
    StringInsert(query string, idx int) string
    StringAdd(query string) string
    StringGetKeywords() []string
    StringGetLastKeyword() string
    StringPopKeyword() (string, []rune)
}

type Suggestion Uses

type Suggestion struct {
}

func NewSuggestion Uses

func NewSuggestion() *Suggestion

func (*Suggestion) Get Uses

func (s *Suggestion) Get(json *simplejson.Json, keyword string) []string

func (*Suggestion) GetCandidateKeys Uses

func (s *Suggestion) GetCandidateKeys(json *simplejson.Json, keyword string) []string

func (*Suggestion) GetCurrentType Uses

func (s *Suggestion) GetCurrentType(json *simplejson.Json) SuggestionDataType

type SuggestionDataType Uses

type SuggestionDataType int
const (
    UNKNOWN SuggestionDataType = iota
    ARRAY
    MAP
    NUMBER
    STRING
    BOOL
)

type SuggestionInterface Uses

type SuggestionInterface interface {
    Get(json *simplejson.Json, keyword string) []string
    GetCandidateKeys(json *simplejson.Json, keyword string) []string
}

type Terminal Uses

type Terminal struct {
    // contains filtered or unexported fields
}

func NewTerminal Uses

func NewTerminal(prompt string, defaultY int, monochrome bool) *Terminal

func (*Terminal) Draw Uses

func (t *Terminal) Draw(attr *TerminalDrawAttributes) error

type TerminalDrawAttributes Uses

type TerminalDrawAttributes struct {
    Query           string
    Contents        []string
    CandidateIndex  int
    ContentsOffsetY int
    Complete        string
    Candidates      []string
    CursorOffset    int
}

Package jid imports 12 packages (graph) and is imported by 2 packages. Updated 2019-05-01. Refresh now. Tools for package owners.