Documentation ¶
Index ¶
- Variables
- func NewExpBackOff(ctx context.Context, start, max time.Duration) backoff.BackOffContext
- type BuffWatcher
- type BufferKind
- type CmdBuff
- func (c *CmdBuff) Add(r rune)
- func (c *CmdBuff) AddListener(w BuffWatcher)
- func (c *CmdBuff) ClearText(fire bool)
- func (c *CmdBuff) Delete()
- func (c *CmdBuff) Empty() bool
- func (c *CmdBuff) GetKind() BufferKind
- func (c *CmdBuff) GetSuggestion() string
- func (c *CmdBuff) GetText() string
- func (c *CmdBuff) InCmdMode() bool
- func (c *CmdBuff) IsActive() bool
- func (c *CmdBuff) RemoveListener(l BuffWatcher)
- func (c *CmdBuff) Reset()
- func (c *CmdBuff) SetActive(b bool)
- func (c *CmdBuff) SetText(text, suggestion string)
- type Component
- type Describe
- func (d *Describe) AddListener(l ResourceViewerListener)
- func (d *Describe) ClearFilter()
- func (d *Describe) Filter(q string)
- func (d *Describe) GetPath() string
- func (d *Describe) Peek() []string
- func (d *Describe) Refresh(ctx context.Context) error
- func (d *Describe) RemoveListener(l ResourceViewerListener)
- func (d *Describe) SetOptions(context.Context, ViewerToggleOpts)
- func (d *Describe) Watch(ctx context.Context) error
- type FishBuff
- func (f *FishBuff) Add(r rune)
- func (f *FishBuff) AutoSuggests() bool
- func (f *FishBuff) ClearSuggestions()
- func (f *FishBuff) CurrentSuggestion() (string, bool)
- func (f *FishBuff) Delete()
- func (f *FishBuff) NextSuggestion() (string, bool)
- func (f *FishBuff) Notify(delete bool)
- func (f *FishBuff) PrevSuggestion() (string, bool)
- func (f *FishBuff) SetSuggestionFn(fn SuggestionFunc)
- func (f *FishBuff) Suggestions() []string
- type Flash
- func (f *Flash) Channel() FlashChan
- func (f *Flash) Clear()
- func (f *Flash) Err(err error)
- func (f *Flash) Errf(fmat string, args ...interface{})
- func (f *Flash) Info(msg string)
- func (f *Flash) Infof(fmat string, args ...interface{})
- func (f *Flash) SetMessage(level FlashLevel, msg string)
- func (f *Flash) Warn(msg string)
- func (f *Flash) Warnf(fmat string, args ...interface{})
- type FlashChan
- type FlashLevel
- type FlashListener
- type Hinter
- type Igniter
- type LevelMessage
- type MenuHint
- type MenuHints
- type Primitive
- type Renderer
- type ResourceMeta
- type ResourceViewer
- type ResourceViewerListener
- type Stack
- func (s *Stack) AddListener(l StackListener)
- func (s *Stack) Clear()
- func (s *Stack) Dump()
- func (s *Stack) Empty() bool
- func (s *Stack) Flatten() []string
- func (s *Stack) IsLast() bool
- func (s *Stack) Peek() []Component
- func (s *Stack) Pop() (Component, bool)
- func (s *Stack) Previous() Component
- func (s *Stack) Push(c Component)
- func (s *Stack) RemoveListener(l StackListener)
- func (s *Stack) Top() Component
- type StackAction
- type StackEvent
- type StackListener
- type SuggestionFunc
- type SuggestionListener
- type Table
- func (t *Table) AddListener(l TableListener)
- func (t *Table) Count() int
- func (t *Table) Empty() bool
- func (t *Table) Get(ctx context.Context, path string) (dao.Object, error)
- func (t *Table) Peek() *render.TableData
- func (t *Table) Refresh(ctx context.Context) error
- func (t *Table) RemoveListener(l TableListener)
- func (t *Table) SetRefreshRate(d time.Duration)
- func (t *Table) Watch(ctx context.Context) error
- type TableListener
- type ViewerToggleOpts
Constants ¶
This section is empty.
Variables ¶
var Registry = map[string]ResourceMeta{ internal.LowercaseEc2: { DAO: &dao.EC2{}, Renderer: &render.EC2{}, }, internal.LowercaseS3: { DAO: &dao.S3{}, Renderer: &render.S3{}, }, internal.LowercaseSg: { DAO: &dao.SG{}, Renderer: &render.SG{}, }, internal.Object: { DAO: &dao.BObj{}, Renderer: &render.BObj{}, }, internal.LowercaseIamUser: { DAO: &dao.IAMU{}, Renderer: &render.IAMU{}, }, internal.LowercaseIamGroup: { DAO: &dao.IAMUG{}, Renderer: &render.IAMUG{}, }, internal.LowercaseIamRole: { DAO: &dao.IamRole{}, Renderer: &render.IamRole{}, }, internal.UserPolicy: { DAO: &dao.IAMUP{}, Renderer: &render.IamUserPloicy{}, }, internal.LowercaseEBS: { DAO: &dao.EBS{}, Renderer: &render.EBS{}, }, internal.UserGroupPolicy: { DAO: &dao.IAMUGP{}, Renderer: &render.IamUserGroupPloicy{}, }, internal.RolePolicy: { DAO: &dao.IamRolePloicy{}, Renderer: &render.IamRolePloicy{}, }, internal.GroupUsers: { DAO: &dao.IamGroupUser{}, Renderer: &render.IamGroupUser{}, }, internal.LowercaseEc2Snapshot: { DAO: &dao.EC2S{}, Renderer: &render.EC2S{}, }, internal.LowercaseEc2Image: { DAO: &dao.EC2I{}, Renderer: &render.EC2I{}, }, internal.LowercaseSQS: { DAO: &dao.SQS{}, Renderer: &render.SQS{}, }, internal.LowercaseVPC: { DAO: &dao.VPC{}, Renderer: &render.VPC{}, }, internal.LowercaseSubnet: { DAO: &dao.Subnet{}, Renderer: &render.Subnet{}, }, internal.LowercaseLamda: { DAO: &dao.Lambda{}, Renderer: &render.Lambda{}, }, }
Functions ¶
func NewExpBackOff ¶
Types ¶
type BuffWatcher ¶
type BuffWatcher interface { // BufferCompleted indicates input was accepted. BufferCompleted(text, suggestion string) // BufferChanged indicates the buffer was changed. BufferChanged(text, suggestion string) // BufferActive indicates the buff activity changed. BufferActive(state bool, kind BufferKind) }
BuffWatcher represents a command buffer listener.
type BufferKind ¶
type BufferKind int8
BufferKind indicates a buffer type.
const ( // CommandBuffer represents a command buffer. CommandBuffer BufferKind = 1 << iota // FilterBuffer represents a filter buffer. FilterBuffer )
type CmdBuff ¶
type CmdBuff struct {
// contains filtered or unexported fields
}
CmdBuff represents user command input.
func NewCmdBuff ¶
func NewCmdBuff(key rune, kind BufferKind) *CmdBuff
NewCmdBuff returns a new command buffer.
func (*CmdBuff) AddListener ¶
func (c *CmdBuff) AddListener(w BuffWatcher)
AddListener registers a cmd buffer listener.
func (*CmdBuff) Delete ¶
func (c *CmdBuff) Delete()
Delete removes the last character from the buffer.
func (*CmdBuff) GetSuggestion ¶
GetSuggestion returns the current suggestion.
func (*CmdBuff) RemoveListener ¶
func (c *CmdBuff) RemoveListener(l BuffWatcher)
RemoveListener removes a listener.
func (*CmdBuff) Reset ¶
func (c *CmdBuff) Reset()
Reset clears out the command buffer and deactivates it.
type Describe ¶
type Describe struct {
// contains filtered or unexported fields
}
Describe tracks describable resources.
func NewDescribe ¶
NewDescribe returns a new describe resource model.
func (*Describe) AddListener ¶
func (d *Describe) AddListener(l ResourceViewerListener)
AddListener adds a new model listener.
func (*Describe) RemoveListener ¶
func (d *Describe) RemoveListener(l ResourceViewerListener)
RemoveListener delete a listener from the list.
func (*Describe) SetOptions ¶
func (d *Describe) SetOptions(context.Context, ViewerToggleOpts)
SetOptions toggle model options.
type FishBuff ¶
type FishBuff struct { *CmdBuff // contains filtered or unexported fields }
FishBuff represents a suggestion buffer.
func NewFishBuff ¶
func NewFishBuff(key rune, kind BufferKind) *FishBuff
NewFishBuff returns a new command buffer.
func (*FishBuff) AutoSuggests ¶
AutoSuggests returns true if model implements auto suggestions.
func (*FishBuff) ClearSuggestions ¶
func (f *FishBuff) ClearSuggestions()
ClearSuggestions clear out all suggestions.
func (*FishBuff) CurrentSuggestion ¶
CurrentSuggestion returns the current suggestion.
func (*FishBuff) Delete ¶
func (f *FishBuff) Delete()
Delete removes the last character from the buffer.
func (*FishBuff) NextSuggestion ¶
NextSuggestion returns the next suggestion.
func (*FishBuff) PrevSuggestion ¶
PrevSuggestion returns the prev suggestion.
func (*FishBuff) SetSuggestionFn ¶
func (f *FishBuff) SetSuggestionFn(fn SuggestionFunc)
SetSuggestionFn sets up suggestions.
func (*FishBuff) Suggestions ¶
Suggestions returns suggestions.
type Flash ¶
type Flash struct {
// contains filtered or unexported fields
}
Flash represents a flash message model.
func (*Flash) SetMessage ¶
func (f *Flash) SetMessage(level FlashLevel, msg string)
SetMessage sets the flash level message.
type FlashLevel ¶
type FlashLevel int
FlashLevel represents flash message severity.
const ( // DefaultFlashDelay sets the flash clear delay. DefaultFlashDelay = 2 * time.Second // FlashInfo represents an info message. FlashInfo FlashLevel = iota // FlashWarn represents an warning message. FlashWarn // FlashErr represents an error message. FlashErr )
type FlashListener ¶
type FlashListener interface { // FlashChanged notifies the model changed. FlashChanged(FlashLevel, string) // FlashCleared notifies when the filter changed. FlashCleared() }
FlashListener represents a text model listener.
type Hinter ¶
type Hinter interface { // Hints returns a collection of menu hints. Hints() MenuHints }
Hinter represent a menu mnemonic provider.
type Igniter ¶
type Igniter interface { // Start starts a component. Init(ctx context.Context) error // Start starts a component. Start() // Stop terminates a component. Stop() }
Igniter represents a runnable view.
type LevelMessage ¶
type LevelMessage struct { Level FlashLevel Text string }
LevelMessage tracks an message and severity.
func (LevelMessage) IsClear ¶
func (l LevelMessage) IsClear() bool
IsClear returns true if message is empty.
type MenuHint ¶
MenuHint represents keyboard mnemonic.
type MenuHints ¶
type MenuHints []MenuHint
MenuHints represents a collection of hints.
type Renderer ¶
type Renderer interface { // Render converts raw resources to tabular data. Render(o interface{}, ns string, row *render.Row) error // Header returns the resource header. Header() render.Header }
Renderer represents a resource renderer.
type ResourceMeta ¶
ResourceMeta represents model info about a resource.
type ResourceViewer ¶
type ResourceViewer interface { GetPath() string Filter(string) ClearFilter() Peek() []string SetOptions(context.Context, ViewerToggleOpts) Watch(context.Context) error Refresh(context.Context) error AddListener(ResourceViewerListener) RemoveListener(ResourceViewerListener) }
type ResourceViewerListener ¶
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack represents a stacks of components.
func (*Stack) AddListener ¶
func (s *Stack) AddListener(l StackListener)
AddListener registers a stack listener.
func (*Stack) RemoveListener ¶
func (s *Stack) RemoveListener(l StackListener)
RemoveListener removes a listener.
type StackAction ¶
type StackAction int
StackAction represents an action on the stack.
const ( // StackPush denotes an add on the stack. StackPush StackAction = 1 << iota // StackPop denotes a delete on the stack. StackPop )
type StackEvent ¶
type StackEvent struct { // Kind represents the event condition. Action StackAction // Item represents the targeted item. Component Component }
StackEvent represents an operation on a view stack.
type StackListener ¶
type StackListener interface { // StackPushed indicates a new item was added. StackPushed(Component) // StackPopped indicates an item was deleted StackPopped(old, new Component) // StackTop indicates the top of the stack StackTop(Component) }
StackListener represents a stack listener.
type SuggestionFunc ¶
type SuggestionFunc func(text string) sort.StringSlice
SuggestionFunc produces suggestions.
type SuggestionListener ¶
type SuggestionListener interface { BuffWatcher // SuggestionChanged notifies suggestion changes. SuggestionChanged(text, sugg string) }
SuggestionListener listens for suggestions.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a table model.
func (*Table) AddListener ¶
func (t *Table) AddListener(l TableListener)
AddListener adds a new model listener.
func (*Table) RemoveListener ¶
func (t *Table) RemoveListener(l TableListener)
RemoveListener delete a listener from the list.
func (*Table) SetRefreshRate ¶
SetRefreshRate sets model refresh duration.
type TableListener ¶
type TableListener interface { // TableDataChanged notifies the model data changed. TableDataChanged(*render.TableData) }
TableListener represents a table model listener.