Documentation ¶
Index ¶
- func ExecCmd(argcmd string) error
- func ExecCmdLines(argcmd string) ([]string, error)
- func RenderTemplate(main0 *template.Template, vmap map[string]interface{}, ...) error
- type PrefixRenderer
- type PrefixWriter
- func (pw *PrefixWriter) AppendNewLineOrDie(s string)
- func (pw *PrefixWriter) Done() error
- func (pw *PrefixWriter) Flush() error
- func (pw *PrefixWriter) PopPrefix() string
- func (pw *PrefixWriter) Prefix() string
- func (pw *PrefixWriter) PushPrefix(prefix string)
- func (pw *PrefixWriter) Write(data []byte) (int, error)
- func (pw *PrefixWriter) WriteOrDie(data []byte)
- func (pw *PrefixWriter) WriteString(data string) (int, error)
- func (pw *PrefixWriter) WriteStringOrDie(data string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCmdLines ¶
ExecCmdLines executes a command using the shell, and return the output lines or an error
func RenderTemplate ¶
func RenderTemplate( main0 *template.Template, vmap map[string]interface{}, tmap map[string]PrefixRenderer, wr io.Writer, ) error
RenderTemplate renders templates respecting indentation Its intended use is for YAML templates check template_test for an example.
Types ¶
type PrefixRenderer ¶
type PrefixRenderer = func(pw *PrefixWriter, params map[string]interface{})
PrefixRenderer writes data to pw
type PrefixWriter ¶
type PrefixWriter struct {
// contains filtered or unexported fields
}
PrefixWriter wraps an io.Writer to add a prefix on each line NB: caller is responsble for calling Flush().
func NewPrefixWriter ¶
func NewPrefixWriter(w io.Writer, skipFirst bool) *PrefixWriter
NewPrefixWriter creates a new PrefixWriter
func (*PrefixWriter) AppendNewLineOrDie ¶
func (pw *PrefixWriter) AppendNewLineOrDie(s string)
AppendNewLineOrDie appends a new line and panics in case of an error here PrefixWriter will not scan the input for new lines
func (*PrefixWriter) Done ¶
func (pw *PrefixWriter) Done() error
Done flushes buffered and and ensures prefix stack is empty
func (*PrefixWriter) Flush ¶
func (pw *PrefixWriter) Flush() error
Flush forces PrefixWriter to flush any buffered data
func (*PrefixWriter) PopPrefix ¶
func (pw *PrefixWriter) PopPrefix() string
PopPrefix pops a prefix from the stack
func (*PrefixWriter) PushPrefix ¶
func (pw *PrefixWriter) PushPrefix(prefix string)
PushPrefix pushes a prefix to the stack
func (*PrefixWriter) WriteOrDie ¶
func (pw *PrefixWriter) WriteOrDie(data []byte)
WriteOrDie writes or panics
func (*PrefixWriter) WriteString ¶
func (pw *PrefixWriter) WriteString(data string) (int, error)
WriteString writes a string
func (*PrefixWriter) WriteStringOrDie ¶
func (pw *PrefixWriter) WriteStringOrDie(data string)
WriteStringOrDie writes a string or panics