Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildContext ¶
type BuildContext struct {
// contains filtered or unexported fields
}
BuildContext tracks the component path for better error messages
func NewBuildContext ¶
func NewBuildContext() *BuildContext
NewBuildContext creates a new build context
func (*BuildContext) Errorf ¶
func (bc *BuildContext) Errorf(format string, args ...interface{}) error
Errorf formats an error with the current component path
func (*BuildContext) Path ¶
func (bc *BuildContext) Path() string
Path returns the current component path as a string
func (*BuildContext) Pop ¶
func (bc *BuildContext) Pop()
Pop removes the last component from the path
func (*BuildContext) Push ¶
func (bc *BuildContext) Push(component string)
Push adds a component to the path
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder orchestrates the building of tview UI from configuration
func NewBuilder ¶
func NewBuilder(ctx *template.Context, registry *template.FunctionRegistry) *Builder
NewBuilder creates a new UI builder
func (*Builder) BuildFromConfig ¶
BuildFromConfig builds a tview primitive from a page configuration
func (*Builder) SetLoader ¶
func (b *Builder) SetLoader(loader PageLoader)
SetLoader sets the page loader for loading nested page configurations
type CallbackAttacher ¶
type CallbackAttacher struct{}
CallbackAttacher handles attaching callbacks to primitives
func NewCallbackAttacher ¶
func NewCallbackAttacher() *CallbackAttacher
NewCallbackAttacher creates a new callback attacher
func (*CallbackAttacher) AttachCallback ¶
func (ca *CallbackAttacher) AttachCallback(primitive tview.Primitive, callback func()) error
AttachCallback attaches a callback function to a primitive
func (*CallbackAttacher) AttachChangeCallback ¶
func (ca *CallbackAttacher) AttachChangeCallback(primitive tview.Primitive, callback func(text string)) error
AttachChangeCallback attaches a change callback to a primitive
type Factory ¶
type Factory struct{}
Factory creates tview primitives based on configuration
func (*Factory) CreatePrimitive ¶
CreatePrimitive creates a tview primitive based on type
func (*Factory) CreatePrimitiveFromPageConfig ¶
CreatePrimitiveFromPageConfig creates a top-level primitive from a page config
type PageLoader ¶
type PageLoader interface {
LoadPage(ref string) (*config.PageConfig, error)
}
PageLoader interface for loading page configurations
type PropertyMapper ¶
type PropertyMapper struct {
// contains filtered or unexported fields
}
PropertyMapper applies YAML properties to tview primitives
func NewPropertyMapper ¶
func NewPropertyMapper(ctx *template.Context, executor *template.Executor) *PropertyMapper
NewPropertyMapper creates a new property mapper
func (*PropertyMapper) ApplyPageProperties ¶
func (pm *PropertyMapper) ApplyPageProperties(primitive tview.Primitive, cfg *config.PageConfig) error
ApplyPageProperties applies page-level properties to a primitive
func (*PropertyMapper) ApplyProperties ¶
ApplyProperties applies configuration properties to a primitive