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 IsLoopback

func IsLoopback(ip net.IP) bool

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 {
	Content string
	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
promptuife
validate