tui

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Queries = map[string]string{

		"commit-info": "SELECT * FROM commits",

		"distinct-authors": "SELECT DISTINCT author_email FROM commits",

		"commits-per-author": `SELECT 
		author_email, count(*) 
		FROM commits GROUP BY author_email 
		ORDER BY count(*) DESC`,

		"author-stats": `SELECT count(DISTINCT commits.id) AS commits, SUM(additions) AS additions, SUM(deletions) AS deletions, author_email
		FROM commits LEFT JOIN stats ON commits.id = stats.commit_id
		WHERE commits.parent_count < 2
		GROUP BY author_email ORDER BY commits`,

		"author-commits-dow": `SELECT
			count(*) AS commits,
			count(CASE WHEN strftime('%w',author_when)='0' THEN 1 END) AS sunday,
			count(CASE WHEN strftime('%w',author_when)='1' THEN 1 END) AS monday,
			count(CASE WHEN strftime('%w',author_when)='2' THEN 1 END) AS tuesday,
			count(CASE WHEN strftime('%w',author_when)='3' THEN 1 END) AS wednesday,
			count(CASE WHEN strftime('%w',author_when)='4' THEN 1 END) AS thursday,
			count(CASE WHEN strftime('%w',author_when)='5' THEN 1 END) AS friday,
			count(CASE WHEN strftime('%w',author_when)='6' THEN 1 END) AS saturday,
			author_email
		FROM commits GROUP BY author_email ORDER BY commits`,

		"tables": `
		SELECT name FROM sqlite_master
		WHERE
			type IN ('table','view') AND
			name NOT LIKE 'sqlite_%'
		`,
	}
)

Functions

func ClearQuery

func ClearQuery(g *gocui.Gui, v *gocui.View) error

Clear's the query view

func DisplayInformation

func DisplayInformation(g *gocui.Gui, ag *askgit.AskGit, length time.Duration) error

Displays a selection of information into the Info view

func GoLeft

func GoLeft(g *gocui.Gui, v *gocui.View) error

func GoRight

func GoRight(g *gocui.Gui, v *gocui.View) error

func HandleClick

func HandleClick(g *gocui.Gui, v *gocui.View) error

handles Left click.

func HandleCursor

func HandleCursor(g *gocui.Gui, v *gocui.View) error

Makes sure Cursor is not more right or more down than allowed

func JumpDown added in v0.3.7

func JumpDown(g *gocui.Gui, v *gocui.View) error

func JumpLeft added in v0.3.7

func JumpLeft(g *gocui.Gui, v *gocui.View) error

func JumpRight added in v0.3.7

func JumpRight(g *gocui.Gui, v *gocui.View) error

func JumpUp added in v0.3.7

func JumpUp(g *gocui.Gui, v *gocui.View) error

func NextLine

func NextLine(g *gocui.Gui, v *gocui.View) error

func NextView

func NextView(g *gocui.Gui, v *gocui.View) error

goes to the next view in the viewArr

func PreviousLine

func PreviousLine(g *gocui.Gui, v *gocui.View) error

Goes to the previous line

func RunGUI

func RunGUI(askgitInstance *askgit.AskGit, q string)

func RunQuery

func RunQuery(g *gocui.Gui, v *gocui.View) error

Run's the query

func SetCurrentViewOnTop

func SetCurrentViewOnTop(g *gocui.Gui, name string) (*gocui.View, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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