render

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeSelect    = "select"
	TypeInput     = "input"
	TypeTextArea  = "textarea"
	DescMaxLength = 50
)
View Source
const (
	TextAreaMaxHeight = 20
	TextWidth         = 50
)

Variables

View Source
var (
	ErrCanceled = errors.New("canceled")
)

Functions

func NewMissingErr

func NewMissingErr(field string) error

func NotBlankValidator

func NotBlankValidator(name string) func(s string) error

NotBlankValidator is a verification function that checks whether the input is empty

Types

type Item

type Item struct {
	Name     string
	Desc     string
	Type     string
	Options  []Option
	Required bool
}

type MissingErr

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

func (MissingErr) Error

func (e MissingErr) Error() string

type Option

type Option struct {
	Name string
	Desc string
}

func (*Option) String

func (o *Option) String() string

type Template

type Template struct {
	Name    string
	Desc    string
	Format  string
	Default bool
	Items   []*Item
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate() (*Template, error)

func (*Template) Run

func (t *Template) Run(noTTY bool) ([]byte, error)

Jump to

Keyboard shortcuts

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