display

package
v1.0.55 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Display

type Display struct {
	Theme    string
	Sections []Section
}

func New

func New() *Display

func (*Display) AddSection

func (d *Display) AddSection(fields ...Field) *Display

func (*Display) WithTheme

func (d *Display) WithTheme(theme string) *Display

type Field

type Field interface {
	Render(string, io.Writer) error
}
type Link struct {
	Label    string
	Required bool
	Tooltip  string
	Value    string
	URL      string
}

func (*Link) Render

func (f *Link) Render(theme string, w io.Writer) error

type List

type List struct {
	Inline        bool
	Label         string
	Required      bool
	Tooltip       string
	Values        []string
	ValueTemplate string
}

func (*List) Render

func (f *List) Render(theme string, w io.Writer) error

type Section

type Section struct {
	Display *Display
	Fields  []Field
}

func (Section) Render

func (s Section) Render() (template.HTML, error)

type Text

type Text struct {
	Label         string
	Required      bool
	Tooltip       string
	Value         string
	ValueTemplate string
}

func (*Text) Render

func (f *Text) Render(theme string, w io.Writer) error

Jump to

Keyboard shortcuts

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