ui

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForConfirmation added in v1.2.0

func AskForConfirmation(prompt string) bool

func Error

func Error(s string) error

func Errorf

func Errorf(format string, a ...interface{}) (n int, err error)

func Errorln

func Errorln(a ...interface{}) (n int, err error)

func PrintTemplate

func PrintTemplate(name string, data interface{})

func Printf

func Printf(format string, a ...interface{}) (n int, err error)

func Println

func Println(a ...interface{}) (n int, err error)

func RenderTemplate

func RenderTemplate(name string, data interface{}) string

func Sprintf added in v1.2.0

func Sprintf(format string, a ...interface{}) string

func Write

func Write(p []byte) (n int, err error)

Types

type Console

type Console struct {
	Stdout io.Writer
	Stderr io.Writer
}

func (Console) Errorf

func (c Console) Errorf(format string, a ...interface{}) (n int, err error)

func (Console) Errorln

func (c Console) Errorln(a ...interface{}) (n int, err error)

func (Console) Printf

func (c Console) Printf(format string, a ...interface{}) (n int, err error)

func (Console) Println

func (c Console) Println(a ...interface{}) (n int, err error)

func (Console) Write

func (c Console) Write(p []byte) (n int, err error)

Won't really work with templates since we aren't buffering at all

type UI

type UI interface {
	Printf(format string, a ...interface{}) (n int, err error)
	Println(a ...interface{}) (n int, err error)
	Errorf(format string, a ...interface{}) (n int, err error)
	Errorln(a ...interface{}) (n int, err error)
	Write(p []byte) (n int, err error)
}
var Default UI = Console{Stdout: os.Stdout, Stderr: os.Stderr}

Jump to

Keyboard shortcuts

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