Documentation ¶
Index ¶
- Variables
- func Ask(prompt string, f func(string) bool) (string, error)
- func AskYesNo(prompt string) (bool, error)
- func AskYesNoWithDefault(prompt string, defaultVal bool) (bool, error)
- func Continue(prompt string, defaultValue bool)
- func Exec(program string, colorStdout bool, args ...string) error
- func NewSlowWriter(newlinePause time.Duration) io.Writer
- func ParseArgumentsWithStrings(val string) []string
- type ActionContext
- type ActionHandler
- type ActionHandlerF
- type CodeActionBlock
- type CommentActionBlock
- type ExecActionHandler
- type Runner
- func (self *Runner) AddVariable(name string, val interface{})
- func (self *Runner) ClearVariable(name string)
- func (self *Runner) EmitTemplatized(s string, out io.Writer) error
- func (self *Runner) HandlePause(*ActionContext) error
- func (self *Runner) HandlePromptForInput(ctx *ActionContext) error
- func (self *Runner) LeftPadBuilder(b *strings.Builder)
- func (self *Runner) RegisterActionHandler(action string, handler ActionHandler)
- func (self *Runner) RegisterActionHandlerF(action string, handler func(ctx *ActionContext) error)
- func (self *Runner) Run(source []byte) error
- func (self *Runner) Template(s string) (string, error)
- type ShowActionHandler
- type WriterWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var CodeAction = CodeActionBlock{}
View Source
var CommentAction = CommentActionBlock{}
Functions ¶
Types ¶
type ActionContext ¶
type ActionHandler ¶
type ActionHandler interface {
Execute(ctx *ActionContext) error
}
type ActionHandlerF ¶
type ActionHandlerF func(ctx *ActionContext) error
func (ActionHandlerF) Execute ¶
func (self ActionHandlerF) Execute(ctx *ActionContext) error
type CodeActionBlock ¶
type CodeActionBlock struct{}
func (CodeActionBlock) GetEndToken ¶
func (self CodeActionBlock) GetEndToken() string
func (CodeActionBlock) GetStartToken ¶
func (self CodeActionBlock) GetStartToken() string
func (CodeActionBlock) IsStarting ¶
func (self CodeActionBlock) IsStarting(source []byte) bool
type CommentActionBlock ¶
type CommentActionBlock struct{}
func (CommentActionBlock) GetEndToken ¶
func (self CommentActionBlock) GetEndToken() string
func (CommentActionBlock) GetStartToken ¶
func (self CommentActionBlock) GetStartToken() string
func (CommentActionBlock) IsStarting ¶
func (self CommentActionBlock) IsStarting(source []byte) bool
type ExecActionHandler ¶
type ExecActionHandler struct{}
func (*ExecActionHandler) Execute ¶
func (self *ExecActionHandler) Execute(ctx *ActionContext) error
type Runner ¶
type Runner struct { LineWidth int LeftPad int NewLinePause time.Duration AssumeDefault bool // contains filtered or unexported fields }
func (*Runner) AddVariable ¶
func (*Runner) ClearVariable ¶
func (*Runner) HandlePause ¶
func (self *Runner) HandlePause(*ActionContext) error
func (*Runner) HandlePromptForInput ¶
func (self *Runner) HandlePromptForInput(ctx *ActionContext) error
func (*Runner) LeftPadBuilder ¶
func (*Runner) RegisterActionHandler ¶
func (self *Runner) RegisterActionHandler(action string, handler ActionHandler)
func (*Runner) RegisterActionHandlerF ¶
func (self *Runner) RegisterActionHandlerF(action string, handler func(ctx *ActionContext) error)
type ShowActionHandler ¶
type ShowActionHandler struct {
// contains filtered or unexported fields
}
func NewShowActionHandler ¶
func NewShowActionHandler() *ShowActionHandler
func (*ShowActionHandler) Add ¶
func (self *ShowActionHandler) Add(name, contents string)
func (*ShowActionHandler) Execute ¶
func (self *ShowActionHandler) Execute(ctx *ActionContext) error
type WriterWrapper ¶
type WriterWrapper struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.