tui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldIsOptional

func FieldIsOptional(name string, value string) error

func FieldIsRequired

func FieldIsRequired(name string, value string) error

func InputCanBeBool

func InputCanBeBool(name string, value string) error

func InputIsInteger

func InputIsInteger(name string, value string) error

func YesOrNo

func YesOrNo(v string) (string, error)

Types

type Field

type Field struct {
	Label     string
	Name      string
	Value     interface{}
	Validator FieldValidator
}

func (*Field) Prompt

func (field *Field) Prompt() error

type FieldValidator

type FieldValidator func(name string, value string) error

type Form

type Form struct {
	Fields []*Field
}

func NewForm

func NewForm() *Form

func (*Form) BuildContent

func (f *Form) BuildContent() (string, error)

func (*Form) ConvertFieldValueToBool

func (f *Form) ConvertFieldValueToBool(fname string)

func (*Form) ConvertFieldValueToInteger

func (f *Form) ConvertFieldValueToInteger(fname string)

func (*Form) NewField

func (f *Form) NewField(label string, name string, value interface{}, fcn FieldValidator) error

func (*Form) Show

func (f *Form) Show() error

type Report

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

func NewReport

func NewReport() Report

func (*Report) Add

func (r *Report) Add(key string, value string)

func (*Report) Break

func (r *Report) Break()

func (*Report) Output

func (r *Report) Output(out io.Writer)

type Table

type Table struct {
	Width int
	Max   []int
	// contains filtered or unexported fields
}

func NewTable

func NewTable(header ...string) Table

func (*Table) Output

func (t *Table) Output(out io.Writer)

func (*Table) Row

func (t *Table) Row(cells ...interface{})

Jump to

Keyboard shortcuts

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