context

package
v0.0.0-...-a7e7b69 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: MPL-2.0 Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

A context is used by the console for state and initialization TODO : finish scratchpad implementation

func NewContext

func NewContext() *Context

Create a new context

func (*Context) Exit

func (c *Context) Exit()

When the active mode is set to nil, the cli will exit

func (*Context) GetCurrentMode

func (c *Context) GetCurrentMode() (mode_interface.Mode, error)

Returns the current active mode

func (*Context) ModeSuggestionsFunc

func (c *Context) ModeSuggestionsFunc(line []string) []prompt.Suggest

Returns a slice of Prompt.Suggest objects containing suggestions for the currently registered modes

func (*Context) RegisterMode

func (c *Context) RegisterMode(m mode_interface.Mode, desc string)

Register a mode that will be usable within the context

func (*Context) SelectMode

func (c *Context) SelectMode(modeName string) (mode_interface.Mode, error)

Select the active mode, based on the mode name

Jump to

Keyboard shortcuts

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