components

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegistryObject = NewComponentRegistry()
	Register       = RegistryObject.Register
	Namespace      = RegistryObject.Namespace
	Render         = RegistryObject.Render
)

Functions

This section is empty.

Types

type Component

type Component interface {
	Render(ctx context.Context, w io.Writer) error
}

type ComponentFunc

type ComponentFunc = interface{} // func(...interface{}) -> Component

type ComponentRegistry

type ComponentRegistry struct {
	// contains filtered or unexported fields
}

func NewComponentRegistry

func NewComponentRegistry() *ComponentRegistry

func (*ComponentRegistry) Namespace

func (r *ComponentRegistry) Namespace(name string) Registry

func (*ComponentRegistry) Register

func (r *ComponentRegistry) Register(name string, componentFn ComponentFunc)

func (*ComponentRegistry) Render

func (r *ComponentRegistry) Render(name string, args ...interface{}) Component

type Registry

type Registry interface {
	Register(name string, componentFn ComponentFunc)
	Render(name string, args ...interface{}) Component
}

Jump to

Keyboard shortcuts

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