builder

package
v0.0.0-...-d0cc00f Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 6 Imported by: 0

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

func (b *Builder) BuildFromConfig(pageConfig *config.PageConfig) (tview.Primitive, error)

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 NewFactory

func NewFactory() *Factory

NewFactory creates a new primitive factory

func (*Factory) CreatePrimitive

func (f *Factory) CreatePrimitive(prim *config.Primitive) (tview.Primitive, error)

CreatePrimitive creates a tview primitive based on type

func (*Factory) CreatePrimitiveFromPageConfig

func (f *Factory) CreatePrimitiveFromPageConfig(cfg *config.PageConfig) (tview.Primitive, error)

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

func (pm *PropertyMapper) ApplyProperties(primitive tview.Primitive, prim *config.Primitive) error

ApplyProperties applies configuration properties to a primitive

Jump to

Keyboard shortcuts

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