hud

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRefreshInterval = 1 * time.Second

The main loop ensures the HUD updates at least this often

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitAction added in v0.1.0

type ExitAction struct{}

func (ExitAction) Action added in v0.1.0

func (ExitAction) Action()

type FakeHud

type FakeHud struct {
	LastView view.View

	Canceled bool
	Closed   bool
	// contains filtered or unexported fields
}

func NewFakeHud

func NewFakeHud() *FakeHud

func (*FakeHud) Close

func (h *FakeHud) Close()

func (*FakeHud) OnChange

func (h *FakeHud) OnChange(ctx context.Context, st *store.Store)

func (*FakeHud) Refresh

func (h *FakeHud) Refresh(ctx context.Context)

func (*FakeHud) Run

func (h *FakeHud) Run(ctx context.Context, dispatch func(action store.Action), refreshInterval time.Duration) error

func (*FakeHud) SetNarrationMessage

func (h *FakeHud) SetNarrationMessage(ctx context.Context, msg string)

func (*FakeHud) Update

func (h *FakeHud) Update(v view.View, vs view.ViewState) error

func (*FakeHud) WaitUntil added in v0.1.0

func (h *FakeHud) WaitUntil(t testing.TB, ctx context.Context, msg string, isDone func(view.View) bool)

type HeadsUpDisplay

type HeadsUpDisplay interface {
	store.Subscriber

	Run(ctx context.Context, dispatch func(action store.Action), refreshRate time.Duration) error
	Update(v view.View, vs view.ViewState) error
	Close()
	SetNarrationMessage(ctx context.Context, msg string)
}

func NewDefaultHeadsUpDisplay

func NewDefaultHeadsUpDisplay(renderer *Renderer) (HeadsUpDisplay, error)

type Hud

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

func (*Hud) Close

func (h *Hud) Close()

func (*Hud) OnChange

func (h *Hud) OnChange(ctx context.Context, st *store.Store)

func (*Hud) Refresh

func (h *Hud) Refresh(ctx context.Context)

func (*Hud) Run

func (h *Hud) Run(ctx context.Context, dispatch func(action store.Action), refreshRate time.Duration) error

func (*Hud) SetNarrationMessage

func (h *Hud) SetNarrationMessage(ctx context.Context, msg string)

func (*Hud) Update

func (h *Hud) Update(v view.View, vs view.ViewState) error

type Renderer

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

func NewRenderer

func NewRenderer(clock func() time.Time) *Renderer

func (*Renderer) Render

func (r *Renderer) Render(v view.View, vs view.ViewState) error

func (*Renderer) Reset

func (r *Renderer) Reset()

func (*Renderer) SetUp

func (r *Renderer) SetUp() (chan tcell.Event, error)

type Scroller added in v0.1.0

type Scroller interface {
	Up()
	Down()
	Top()
	Bottom()
}

type ShowErrorAction

type ShowErrorAction struct {
	// 1-based index of resource whose log should be printed
	ResourceNumber int
}

func NewShowErrorAction

func NewShowErrorAction(resourceNumber int) ShowErrorAction

func (ShowErrorAction) Action

func (ShowErrorAction) Action()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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