ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Core is the core view.
	Core string = "core"
	// Dector is the dector view.
	Dector string = "dector"
	// Switcher is the switcher view.
	Switcher string = "switcher"
	// Informer is the informer view.
	Informer string = "informer"
	// Follower is th follower view.
	Follower string = "follower"
	// Remover is the remover view.
	Remover string = "remover"
	// Messenger is the messenger view.
	Messenger string = "messenger"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager is the manager of UI.

func NewManager

func NewManager(mock runtime.UseCase, namespace runtime.UseCase, workflow runtime.UseCase) *Manager

NewManager create a new UI manager. The namespace of the manager is depends on the configuration of the user.

func (*Manager) Error

func (m *Manager) Error(g *gocui.Gui, message string)

Error show up the message on the Messenger. It's recommended to use in GUI level such as keybinding and laytout.

func (*Manager) Keybinding

func (m *Manager) Keybinding(g *gocui.Gui) error

Keybinding keybinding of views in the manager.

func (*Manager) Layout

func (m *Manager) Layout(g *gocui.Gui) error

Layout lay out the resource of service.

func (*Manager) NewDector

func (m *Manager) NewDector(g *gocui.Gui, init string) error

NewDector create and switch to the dector.

func (*Manager) NewFollower

func (m *Manager) NewFollower(g *gocui.Gui, key string) error

NewFollower create a new view to follow logs of a object.

func (*Manager) NewInformer

func (m *Manager) NewInformer(g *gocui.Gui, key string) error

NewInformer create a new view to display the information of a object.

func (*Manager) NewRemover

func (m *Manager) NewRemover(g *gocui.Gui, key string) error

NewRemover switch to the remover and confirm to delete or not.

func (*Manager) NewSwitcher

func (m *Manager) NewSwitcher(g *gocui.Gui) error

NewSwitcher create and switch to the Switcher

func (*Manager) ReturnDector

func (m *Manager) ReturnDector(g *gocui.Gui) (string, error)

ReturnDector return the result from the dector and back to the Core.

func (*Manager) ReturnFollower

func (m *Manager) ReturnFollower(g *gocui.Gui) error

ReturnFollower switch to the Core.

func (*Manager) ReturnInformer

func (m *Manager) ReturnInformer(g *gocui.Gui) error

ReturnInformer switch to the Core.

func (*Manager) ReturnRemover

func (m *Manager) ReturnRemover(g *gocui.Gui, delete bool) error

ReturnRemover switch to the Core.

func (*Manager) ReturnSwitcher

func (m *Manager) ReturnSwitcher(g *gocui.Gui) (runtime.UseCase, error)

ReturnSwitcher return the service from the switcher and back to the Core.

func (*Manager) Warn

func (m *Manager) Warn(g *gocui.Gui, message string)

Warn show up the message on the Messenger. It's recommended to use in GUI level such as keybinding and laytout.

type ManagerIface

type ManagerIface interface {
	Layout(g *gocui.Gui) error
	Keybinding(g *gocui.Gui) error

	// Dector
	NewDector(g *gocui.Gui, init string) error
	ReturnDector(g *gocui.Gui) (string error)

	// Switcher
	NewSwitcher(g *gocui.Gui) error
	ReturnSwitcher(g *gocui.Gui) (svc.UseCase, error)

	// Informer
	NewInformer(g *gocui.Gui) error
	ReturnInformer(g *gocui.Gui) error

	// Follower
	NewFollower(g *gocui.Gui, key string) error
	ReturnFollower(g *gocui.Gui) error

	// Remover
	NewRemover(g *gocui.Gui, key string) error
	ReturnRemover(g *gocui.Gui, delete bool) error

	// Messenger
	Warn(*gocui.Gui, string)
	Error(*gocui.Gui, string)
}

ManagerIface is the interface of manager.

type Presentor

type Presentor interface {
	PresentCore(*gocui.View, []runtime.Object) error
	PresentInformer(*gocui.View, runtime.Object) error
	PresentFollower(*gocui.View, []svc.Log) error
}

Presentor present the resource looks pretty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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