termdash

package
v0.0.0-...-69999d2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "dashboard",
	Short: "Start a Funnel dashboard in your terminal.",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if tesServer == "" {
			if val := os.Getenv("FUNNEL_SERVER"); val != "" {
				tesServer = val
			} else {
				tesServer = defaultTesServer
			}
		}
	},
	Args: cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		return termdash(tesServer)
	},
}

Cmd represents the worker command

View Source
var Sorters = map[string]sortMethod{
	"id":          idSorter,
	"state":       stateSorter,
	"name":        nameSorter,
	"description": descSorter,
}

Functions

func Display

func Display() bool

func ExpandView

func ExpandView(t *TaskWidget)

func FilterMenu

func FilterMenu()

func HandleKeys

func HandleKeys(i string, f func())

Apply a common handler function to all given keys

func HelpMenu

func HelpMenu()

func NextPage

func NextPage()

func PreviousPage

func PreviousPage()

func RedrawRows

func RedrawRows(clr bool)

func RefreshDisplay

func RefreshDisplay()

func Shutdown

func Shutdown()

func SortFields

func SortFields() (fields []string)

func SortMenu

func SortMenu()

Types

type GridCursor

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

func NewGridCursor

func NewGridCursor(tesHTTPServerAddress string) (*GridCursor, error)

func (*GridCursor) Down

func (gc *GridCursor) Down()

func (*GridCursor) Idx

func (gc *GridCursor) Idx() int

Return current cursor index

func (*GridCursor) Len

func (gc *GridCursor) Len() int

func (*GridCursor) NextPageExists

func (gc *GridCursor) NextPageExists() bool

func (*GridCursor) PgDown

func (gc *GridCursor) PgDown()

func (*GridCursor) PgUp

func (gc *GridCursor) PgUp()

func (*GridCursor) PreviousPageExists

func (gc *GridCursor) PreviousPageExists() bool

func (*GridCursor) RefreshTask

func (gc *GridCursor) RefreshTask(id string) (*TaskWidget, error)

Refresh a single task

func (*GridCursor) RefreshTaskList

func (gc *GridCursor) RefreshTaskList(previous, next bool) (lenChanged bool)

Refresh task list

func (*GridCursor) Reset

func (gc *GridCursor) Reset()

Set an initial cursor position, if possible

func (*GridCursor) ScrollPage

func (gc *GridCursor) ScrollPage()

func (*GridCursor) Selected

func (gc *GridCursor) Selected() *TaskWidget

func (*GridCursor) Up

func (gc *GridCursor) Up()

type TaskSource

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

func NewTaskSource

func NewTaskSource(tesHTTPServerAddress string, pageSize int32) (*TaskSource, error)

func (*TaskSource) Get

func (ts *TaskSource) Get(id string) (*TaskWidget, error)

Get a single task, by ID

func (*TaskSource) GetNextPage

func (ts *TaskSource) GetNextPage() string

func (*TaskSource) GetPreviousPage

func (ts *TaskSource) GetPreviousPage() string

func (*TaskSource) List

func (ts *TaskSource) List(previous, next bool) (TaskWidgets, error)

Return array of tasks, sorted by field

type TaskWidget

type TaskWidget struct {
	Task    *tes.Task
	Widgets *compact.Compact
	// contains filtered or unexported fields
}

func NewTaskWidget

func NewTaskWidget(t *tes.Task) *TaskWidget

type TaskWidgets

type TaskWidgets []*TaskWidget

func (TaskWidgets) Filter

func (a TaskWidgets) Filter()

func (TaskWidgets) Len

func (a TaskWidgets) Len() int

func (TaskWidgets) Less

func (a TaskWidgets) Less(i, j int) bool

func (TaskWidgets) Swap

func (a TaskWidgets) Swap(i, j int)

type TesTaskSource

type TesTaskSource interface {
	List(bool, bool) (TaskWidgets, error)
	Get(string) (*TaskWidget, error)
	GetNextPage() string
	GetPreviousPage() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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