Versions in this module Expand all Collapse all v0 v0.0.15 Jun 21, 2020 v0.0.14 Jun 21, 2020 Changes in this version type Term + func (c *Term) Help() v0.0.12 Jun 14, 2020 v0.0.11 Jun 14, 2020 Changes in this version + const CR + const ClearAll + const NL + const TimeFormatHuman + func InputChan(file *os.File) <-chan rune + func ProcessInput(ctx context.Context, file *os.File, commands Commands) + func Prompt(format string, v ...interface{}) + func PromptVerbose(format string, v ...interface{}) + func SetCommands(c Commands) + func SetupLogging(setup LogSetupFunc) + func SigWait(ctx context.Context, cancel context.CancelFunc) (os.Signal, error) + func WithSigWait(parent context.Context, opt ...Option) (context.Context, context.CancelFunc) + type Clock struct + func (c *Clock) Chars(tickInterval time.Duration) string + func (c *Clock) DisplayTime(tickInterval time.Duration) *DisplayTime + func (c *Clock) Start(ctx context.Context, tickTime time.Duration) <-chan *DisplayTime + type Command struct + Fn func() + Key rune + Name string + func (c *Command) Run() + func (c *Command) StartsWithKey() bool + type CommandInfoFormatter func(Command) string + type Commands []Command + func GetCommands() Commands + func QuitCommands(fn func()) Commands + func (c Commands) Get(r rune) *Command + func (c Commands) Help() string + func (c Commands) Info(fn CommandInfoFormatter) []string + func (c Commands) Run(r rune) error + func (c Commands) RunScript(s string) error + func (c Commands) String() string + type DisplayTime struct + type LogSetupFunc func(out io.Writer, timeFormat string) error + type Option func(*options) + func WithInput(commands []Command) Option + func WithQuit() Option + func WithoutClock() Option + type RestoreFunc func() error + func ClaimTerminal() (RestoreFunc, error) + type Term struct + func AcquireTerm() (*Term, func()) + func GetTerm() *Term + func (c *Term) GetClock() *Clock + func (c *Term) GetMessage() string + func (c *Term) IsDebug() bool + func (c *Term) IsRaw() bool + func (c *Term) IsVerbose() bool + func (c *Term) Println(s string) (int, error) + func (c *Term) Prompt(v ...string) + func (c *Term) SetDebug(v bool) + func (c *Term) SetMessage(msg string) + func (c *Term) SetVerbose(v bool) + func (c *Term) StartClock(ctx context.Context) + func (c *Term) Sync() (int, error) + func (c *Term) WrapOutput(w io.Writer) + func (c *Term) Write(b []byte) (int, error) + func (c *Term) WriteString(s string) (int, error)