frontend

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallVerifyMethod

func CallVerifyMethod(cfgI interface{}) error

func DumpTemplate

func DumpTemplate(tmplstr string, cfg interface{}) error

func EditStructWithVerifier

func EditStructWithVerifier(fe Frontend, tmplstr string, cfg interface{}, VerifyCfg func(cfg interface{}) error) error

func IsNoDefaultSpecifiedInYaml added in v0.1.0

func IsNoDefaultSpecifiedInYaml(bs []byte) bool

FIXME[P3]: move this to some other pkg?

func PrependYamlCommentLiteral

func PrependYamlCommentLiteral(s string) string

func StripErrorText

func StripErrorText(s string) string

Types

type ConfigItem

type ConfigItem struct {
	Label    string
	Validate func(string) error
	Value    *string
}

type Frontend

type Frontend interface {
	Confirm(question string) error
	IsInteractive() bool
	EditText(template string, validator func(string) (string, error)) (edited string, err error)
	Configure([]ConfigItem) error
}

type NonInteractive

type NonInteractive struct {
	Logger *zap.Logger
}

func (*NonInteractive) Configure

func (fe *NonInteractive) Configure(items []ConfigItem) error

func (*NonInteractive) Confirm

func (fe *NonInteractive) Confirm(q string) error

func (*NonInteractive) EditText

func (fe *NonInteractive) EditText(beforeEdit string, validator func(string) (string, error)) (string, error)

func (*NonInteractive) IsInteractive added in v0.1.0

func (fe *NonInteractive) IsInteractive() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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