renderer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRendererNotFound = errors.New("renderer not found")
View Source
var JSON = json{}
View Source
var YAML = yaml{}

Functions

This section is empty.

Types

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (Renderer, error)

func (*Registry) Register

func (r *Registry) Register(name string, renderer Renderer) error

type RegistryBuilder

type RegistryBuilder []func(*Registry) error
var (
	LocalRegistryBuilder RegistryBuilder
	AddToRegistry        = LocalRegistryBuilder.AddToRegistry
)

func (*RegistryBuilder) Add

func (r *RegistryBuilder) Add(funcs ...func(*Registry) error)

func (*RegistryBuilder) AddToRegistry

func (r *RegistryBuilder) AddToRegistry(registry *Registry) error

func (*RegistryBuilder) Register

func (r *RegistryBuilder) Register(namesAndRenderers ...any)

type Renderer

type Renderer interface {
	Render(v any, w io.Writer) error
}

func NewTable

func NewTable(converter tableconverter.TableConverter[any]) Renderer

Jump to

Keyboard shortcuts

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