yiq

package module
v0.0.0-...-1fb7267 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 10 Imported by: 0

README

yiq

It's jiq with yq.

You can drill down interactively by using yq filtering queries.

yiq uses yq internally, and it requires you to have yq in your PATH.

Demo

T.B.D.

Installation

Either prebuilt binary for your system (and make sure to chmod +x it first) or install/compile with Go:

go get github.com/zoetrope/yiq/cmd/yiq

If you don't have yq installed, follow instructions at https://github.com/mikefarah/yq/releases and make sure to put it in your PATH.

Usage

Quick start
simple example
cat > sample.yaml <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  name: sample
  labels:
    app: ubuntu
spec:
  replicas: 2
  selector:
    matchLabels:
      app: ubuntu
  template:
    metadata:
      labels:
        app: ubuntu
    spec:
      containers:
      - name: ubuntu
        image: ubuntu:18.04
EOF
cat sample.yaml | yiq

Documentation

Index

Constants

View Source
const (
	DefaultY     int    = 1
	FilterPrompt string = "[yq]> "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func NewEngine

func NewEngine(s io.Reader, args []string, initialquery string) *Engine

func (*Engine) Run

func (e *Engine) Run() *EngineResult

type EngineResult

type EngineResult struct {
	Content string
	Qs      string
	Err     error
}

type Query

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

func NewQuery

func NewQuery(query []rune) *Query

func (*Query) Add

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

func (*Query) Clear

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

func (*Query) Delete

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

func (*Query) Get

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

func (*Query) GetKeywords

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

func (*Query) GetLastKeyword

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

func (*Query) Insert

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

func (*Query) PopKeyword

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

func (*Query) Set

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

func (*Query) StringAdd

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

func (*Query) StringGet

func (q *Query) StringGet() string

func (*Query) StringGetKeywords

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

func (*Query) StringGetLastKeyword

func (q *Query) StringGetLastKeyword() string

func (*Query) StringInsert

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

func (*Query) StringPopKeyword

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

func (*Query) StringSet

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

func (*Query) StringSplitLastKeyword

func (q *Query) StringSplitLastKeyword() (string, string)

type Terminal

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

func NewTerminal

func NewTerminal(prompt string, defaultY int) *Terminal

type TerminalDrawAttributes

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

Directories

Path Synopsis
cmd
yiq

Jump to

Keyboard shortcuts

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