Documentation
¶
Index ¶
- type AppContext
- type HookHandler
- type HookManager
- type HookPoint
- type KeyPlugin
- type KeyRegistration
- type Plugin
- type PluginInfo
- type Registry
- func (r *Registry) GetReaders() []domain.PRReader
- func (r *Registry) GetRepoManagers() []domain.RepoManager
- func (r *Registry) GetReviewers() []domain.PRReviewer
- func (r *Registry) GetWriters() []domain.PRWriter
- func (r *Registry) Hooks() *HookManager
- func (r *Registry) Register(p Plugin) error
- func (r *Registry) Unregister(name string)
- type ViewPlugin
- type ViewRegistration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppContext ¶
type AppContext interface {
ConfigValue(key string) any
ThemeName() string
CurrentRepo() domain.RepoRef
SendMessage(tea.Msg)
}
AppContext provides plugins access to application state during Init().
type HookHandler ¶
HookHandler is a function that handles a lifecycle event.
type HookManager ¶
type HookManager struct {
// contains filtered or unexported fields
}
HookManager manages event hooks with thread-safe registration and emission.
func (*HookManager) Emit ¶
Emit calls all handlers for a hook point in registration order. If any handler returns an error, emission stops and the error is returned.
func (*HookManager) On ¶
func (hm *HookManager) On(point HookPoint, handler HookHandler)
On registers a handler for a hook point.
type HookPoint ¶
type HookPoint string
HookPoint identifies a lifecycle event that plugins can hook into.
type KeyPlugin ¶
type KeyPlugin interface {
Plugin
KeyBindings() []KeyRegistration
}
KeyPlugin provides custom key bindings.
type KeyRegistration ¶
type KeyRegistration struct {
Key key.Binding // The key binding
View string // Which view this applies to ("" = global)
Action func() tea.Cmd // Action to execute
}
KeyRegistration describes a custom key binding provided by a plugin.
type Plugin ¶
type Plugin interface {
Info() PluginInfo
Init(app AppContext) tea.Cmd
}
Plugin is the base interface all plugins must implement.
type PluginInfo ¶
type PluginInfo struct {
Name string // unique identifier: "ghcli", "github-api"
Version string // semver
Description string // human-readable
Provides []string // capabilities: "pr-reader", "pr-reviewer"
}
PluginInfo contains metadata about a plugin.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages plugin lifecycle and capability discovery.
func (*Registry) GetReaders ¶
GetReaders returns all registered PRReader implementations.
func (*Registry) GetRepoManagers ¶
func (r *Registry) GetRepoManagers() []domain.RepoManager
GetRepoManagers returns all registered RepoManager implementations. Future-ready: for plugin authors to provide custom repo management. Current MVP wiring uses direct injection via tui.WithRepoManager().
func (*Registry) GetReviewers ¶
func (r *Registry) GetReviewers() []domain.PRReviewer
GetReviewers returns all registered PRReviewer implementations.
func (*Registry) GetWriters ¶
GetWriters returns all registered PRWriter implementations.
func (*Registry) Register ¶
Register adds a plugin and auto-discovers its capabilities via type assertion.
func (*Registry) Unregister ¶
Unregister removes a plugin by name.
type ViewPlugin ¶
type ViewPlugin interface {
Plugin
Views() []ViewRegistration
}
ViewPlugin provides custom UI views.