view

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRefreshRate = time.Second * 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*ui.App
	Content *PageStack

	IsPageContentSorted bool
	// contains filtered or unexported fields
}

func NewApp

func NewApp() *App

func (*App) GetContext

func (a *App) GetContext() context.Context

func (*App) Init

func (a *App) Init(ctx context.Context, profiles, regions []string) error

TODO keep context param at first place always

func (*App) PrevCmd

func (a *App) PrevCmd(evt *tcell.EventKey) *tcell.EventKey

PrevCmd pops the command stack.

func (*App) QueueUpdateDraw

func (a *App) QueueUpdateDraw(f func())

QueueUpdateDraw queues up a ui action and redraw the ui.

func (*App) Run

func (a *App) Run() error

func (*App) SetContext

func (a *App) SetContext(ctx context.Context)

type BindKeysFunc

type BindKeysFunc func(ui.KeyActions)

BindKeysFunc adds new menu actions.

type Browser

type Browser struct {
	*Table
	// contains filtered or unexported fields
}

Browser represents a generic resource browser.

func (*Browser) GetTable

func (b *Browser) GetTable() *Table

GetTable returns the underlying table.

func (*Browser) Init

func (b *Browser) Init(ctx context.Context) error

Init watches all running pods in given namespace.

func (*Browser) Name

func (b *Browser) Name() string

Name returns the component name.

func (*Browser) SetContextFn

func (b *Browser) SetContextFn(f ContextFunc)

SetContextFn populates a custom context.

func (*Browser) Start

func (b *Browser) Start()

Start initializes browser updates.

func (*Browser) Stop

func (b *Browser) Stop()

Stop terminates browser updates.

type Command

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

Command represents a user command.

func NewCommand

func NewCommand(app *App) *Command

NewCommand returns a new command.

func (*Command) Init

func (c *Command) Init() error

Init initializes the command.

func (*Command) Reset

func (c *Command) Reset(clear bool) error

Reset resets Command and reload aliases.

type ContextFunc

type ContextFunc func(context.Context) context.Context

ContextFunc enhances a given context.

type Cow

type Cow struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Cow represents a bomb viewer.

func NewCow

func NewCow(app *App, says string) *Cow

NewCow returns a have a cow viewer.

func (*Cow) Actions

func (c *Cow) Actions() ui.KeyActions

Actions returns menu actions.

func (*Cow) ExtraHints

func (c *Cow) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Cow) Hints

func (c *Cow) Hints() model.MenuHints

Hints returns menu hints.

func (*Cow) InCmdMode

func (*Cow) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Cow) Init

func (c *Cow) Init(_ context.Context) error

Init initializes the viewer.

func (*Cow) Name

func (c *Cow) Name() string

Name returns the component name.

func (*Cow) Start

func (c *Cow) Start()

Start starts the view updater.

type EBS

type EBS struct {
	ResourceViewer
}

type EC2

type EC2 struct {
	ResourceViewer
}

type EC2I

type EC2I struct {
	ResourceViewer
}

type EC2S

type EC2S struct {
	ResourceViewer
}

type EnterFunc

type EnterFunc func(app *App, model ui.Tabular, resource, path string)

EnterFunc represents an enter key action.

type Help

type Help struct {
	*Table
	// contains filtered or unexported fields
}

Help presents a help viewer.

func NewHelp

func NewHelp(app *App) *Help

NewHelp returns a new help viewer.

func (*Help) Init

func (h *Help) Init(ctx context.Context) error

Init initializes the component.

type HelpFunc

type HelpFunc func() model.MenuHints

HelpFunc processes menu hints.

type IAMU

type IAMU struct {
	ResourceViewer
}

type IAMUG

type IAMUG struct {
	ResourceViewer
}

type IamGroupUser

type IamGroupUser struct {
	ResourceViewer
}

type IamRole

type IamRole struct {
	ResourceViewer
}

type IamRolePloicy

type IamRolePloicy struct {
	ResourceViewer
}

type Lambda

type Lambda struct {
	ResourceViewer
}

type LiveView

type LiveView struct {
	*tview.Flex
	// contains filtered or unexported fields
}

LiveView represents a live text viewer.

func NewLiveView

func NewLiveView(app *App, title string, m model.ResourceViewer) *LiveView

NewLiveView returns a live viewer.

func (*LiveView) Actions

func (v *LiveView) Actions() ui.KeyActions

Actions returns menu actions.

func (*LiveView) BufferActive

func (v *LiveView) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*LiveView) BufferChanged

func (v *LiveView) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*LiveView) BufferCompleted

func (v *LiveView) BufferCompleted(text, _ string)

BufferCompleted indicates input was accepted.

func (*LiveView) ExtraHints

func (v *LiveView) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*LiveView) Hints

func (v *LiveView) Hints() model.MenuHints

Hints returns menu hints.

func (*LiveView) InCmdMode

func (v *LiveView) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*LiveView) Init

func (v *LiveView) Init(_ context.Context) error

Init initializes the viewer.

func (*LiveView) Name

func (v *LiveView) Name() string

Name returns the component name.

func (*LiveView) ResourceChanged

func (v *LiveView) ResourceChanged(lines []string, matches fuzzy.Matches)

ResourceChanged notifies when the filter changes.

func (*LiveView) ResourceFailed

func (v *LiveView) ResourceFailed(err error)

ResourceFailed notifies when their is an issue.

func (*LiveView) Start

func (v *LiveView) Start()

Start starts the view updater.

func (*LiveView) Stop

func (v *LiveView) Stop()

Stop terminates the updater.

type MetaViewer

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

MetaViewer represents a registered meta viewer.

type MetaViewers

type MetaViewers map[string]MetaViewer

MetaViewers represents a collection of meta viewers.

type ObjectParams

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

type PageStack

type PageStack struct {
	*ui.Pages
	// contains filtered or unexported fields
}

PageStack represents a stack of pages.

func NewPageStack

func NewPageStack() *PageStack

NewPageStack returns a new page stack.

func (*PageStack) Init

func (p *PageStack) Init(ctx context.Context) (err error)

Init initializes the view.

func (*PageStack) StackPopped

func (p *PageStack) StackPopped(o, top model.Component)

StackPopped notifies a page was removed.

func (*PageStack) StackPushed

func (p *PageStack) StackPushed(c model.Component)

StackPushed notifies a new page was added.

func (*PageStack) StackTop

func (p *PageStack) StackTop(top model.Component)

StackTop notifies for the top component.

type ResourceViewer

type ResourceViewer interface {
	TableViewer

	Resource() string

	// SetContextFn provision a custom context.
	SetContextFn(ContextFunc)

	// AddBindKeys provision additional key bindings.
	AddBindKeysFn(BindKeysFunc)
}

ResourceViewer represents a generic resource viewer.

func NewBrowser

func NewBrowser(resource string) ResourceViewer

NewBrowser returns a new browser.

func NewEBS

func NewEBS(resource string) ResourceViewer

func NewEC2

func NewEC2(resource string) ResourceViewer

NewPod returns a new viewer.

func NewEC2I

func NewEC2I(resource string) ResourceViewer

func NewEC2S

func NewEC2S(resource string) ResourceViewer

func NewIAMU

func NewIAMU(resource string) ResourceViewer

NewSG returns a new viewer.

func NewIAMUG

func NewIAMUG(resource string) ResourceViewer

NewUG returns a new viewer.

func NewIamGroupUser

func NewIamGroupUser(resource string) ResourceViewer

func NewIamRole

func NewIamRole(resource string) ResourceViewer

NewSG returns a new viewer.

func NewIamRolePloicy

func NewIamRolePloicy(resource string) ResourceViewer

func NewIamUserGroupPloicy

func NewIamUserGroupPloicy(resource string) ResourceViewer

func NewIamUserPloicy

func NewIamUserPloicy(resource string) ResourceViewer

func NewLambda

func NewLambda(resource string) ResourceViewer

func NewS3

func NewS3(resource string) ResourceViewer

func NewSG

func NewSG(resource string) ResourceViewer

NewSG returns a new viewer.

func NewSQS

func NewSQS(resource string) ResourceViewer

NewPod returns a new viewer.

func NewSubnet

func NewSubnet(resource string) ResourceViewer

NewPod returns a new viewer.

func NewVPC

func NewVPC(resource string) ResourceViewer

NewPod returns a new viewer.

type S3

type S3 struct {
	ResourceViewer
}

type S3FileViewer

type S3FileViewer struct {
	ResourceViewer
	// contains filtered or unexported fields
}

func NewS3FileViewer

func NewS3FileViewer(path, resource string) *S3FileViewer

func (*S3FileViewer) Name

func (obj *S3FileViewer) Name() string

type SG

type SG struct {
	ResourceViewer
}

type SQS

type SQS struct {
	ResourceViewer
}

type Subnet

type Subnet struct {
	ResourceViewer
}

type Tab

type Tab struct {
	*App
	// contains filtered or unexported fields
}

func NewTab

func NewTab(app *App) *Tab

func (*Tab) Add

func (t *Tab) Add()

type Table

type Table struct {
	*ui.Table
	// contains filtered or unexported fields
}

Table represents a table viewer.

func NewTable

func NewTable(res string) *Table

NewTable returns a new viewer.

func (*Table) AddBindKeysFn

func (t *Table) AddBindKeysFn(f BindKeysFunc)

AddBindKeysFn adds additional key bindings.

func (*Table) App

func (t *Table) App() *App

App returns the current app handle.

func (*Table) Init

func (t *Table) Init(ctx context.Context) (err error)

Init initializes the component.

func (*Table) Name

func (t *Table) Name() string

Name returns the table name.

func (*Table) SetEnterFn

func (t *Table) SetEnterFn(f EnterFunc)

SetEnterFn specifies the default enter behavior.

func (*Table) Start

func (t *Table) Start()

Start runs the component.

func (*Table) Stop

func (t *Table) Stop()

Stop terminates the component.

type TableViewer

type TableViewer interface {
	Viewer

	// Table returns a table component.
	GetTable() *Table
}

TableViewer represents a tabular viewer.

type VPC

type VPC struct {
	ResourceViewer
}

type Viewer

type Viewer interface {
	model.Component

	// Actions returns active menu bindings.
	Actions() ui.KeyActions

	// App returns an app handle.
	App() *App

	// Refresh updates the viewer
	Refresh()
}

Viewer represents a component viewer.

type ViewerFunc

type ViewerFunc func(string) ResourceViewer

ViewerFunc returns a viewer matching a given gvr.

Jump to

Keyboard shortcuts

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