interfaces

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category string

Category groups related commands for help display

const (
	CategorySession      Category = "Session Management"
	CategoryPTY          Category = "PTY Management"
	CategoryGit          Category = "Git Integration"
	CategoryNavigation   Category = "Navigation"
	CategoryOrganization Category = "Organization"
	CategoryView         Category = "View"
	CategorySystem       Category = "System"
	CategoryLegacy       Category = "Legacy"
	CategorySpecial      Category = "Special" // Hidden from main help
)

Standard command categories

type CommandContext

type CommandContext struct {
	Command  interface{} // The actual command (opaque to avoid circular import)
	Args     map[string]interface{}
	AppState interface{}
	UIState  interface{}
	Key      string
}

CommandContext provides context and state to command handlers

type CommandHandler

type CommandHandler func(ctx *CommandContext) error

CommandHandler is the function signature for command implementations

type CommandID

type CommandID string

CommandID uniquely identifies a command

type CommandInterface

type CommandInterface interface {
	GetID() CommandID
	GetName() string
	GetDescription() string
	GetCategory() Category
	GetContexts() []ContextID
	GetKeys() []string
	IsDeprecated() bool
	GetDeprecationInfo() *DeprecationInfo
	Execute(ctx *CommandContext) error
}

CommandInterface defines the interface for commands

type ContextID

type ContextID string

ContextID identifies different application contexts/modes

const (
	ContextGlobal    ContextID = "global"
	ContextList      ContextID = "list"
	ContextPTYList   ContextID = "pty-list"
	ContextGitStatus ContextID = "git-status"
	ContextHelp      ContextID = "help"
	ContextPrompt    ContextID = "prompt"
	ContextSearch    ContextID = "search"
	ContextConfirm   ContextID = "confirm"
)

Standard application contexts

type ContextInterface

type ContextInterface interface {
	GetID() ContextID
	GetName() string
	GetDescription() string
	GetParent() *ContextID
}

ContextInterface defines the interface for contexts

type DeprecationInfo

type DeprecationInfo struct {
	Message     string
	Alternative CommandID
	RemoveIn    string
}

DeprecationInfo tracks deprecated commands and their alternatives

type Instance

type Instance interface {
	GetPermissions() session.InstancePermissions
}

Instance represents a session instance with permission checks This interface allows command filtering without importing the full session package

type KeyConflict

type KeyConflict struct {
	Key      string
	Context  ContextID
	Commands []CommandID
}

KeyConflict represents a keybinding conflict within a context

type RegistryInterface

type RegistryInterface interface {
	// Command management
	GetCommand(id CommandID) (CommandInterface, bool)
	GetAllCommands() map[CommandID]CommandInterface
	GetKeysForCommand(cmdID CommandID) []string
	ResolveCommand(contextID ContextID, key string) CommandInterface

	// Context management
	GetContext(id ContextID) (ContextInterface, bool)
	GetCommandsForContext(contextID ContextID) []CommandInterface

	// Validation
	DetectConflicts() []KeyConflict
}

RegistryInterface defines the interface for command registries

Jump to

Keyboard shortcuts

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