frontend

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 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 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
	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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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