Documentation ¶
Overview ¶
Package util contains general purpose utility and logging functions.
Index ¶
- Variables
- func Debug(group string, format string, any ...interface{})
- func Deprecate(message string)
- func Error(group string, format string, any ...interface{}) error
- func FileExists(filename string) bool
- func FindUp(start, path string) string
- func Info(group string, format string, any ...interface{})
- func InfoColorful(group string, format string, any ...interface{})
- func Outdated(srcGlobs, destGlobs []string) bool
- func PackageName(sourceFile string) (string, error)
- func Panic(group string, format string, any ...interface{})
- func PartitionKV(r io.Reader, prefix string, assignment string) ([]map[string]string, error)
- func Prompt(prompt string) string
- func PromptPassword(prompt string) string
- func StrTemplate(src string, data map[string]interface{}) (string, error)
- func Template(src string, dest string, data map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
var LogWriter io.Writer
LogWriter is the writer to which the logs are written
Functions ¶
func InfoColorful ¶ added in v2.0.9
InfoColorful writes an info statement to stdout changing colors on succession.
func Outdated ¶
Outdated determines if ANY src has been modified after ANY dest.
For example: *.go.html -> *.go
If any go.html has changed then generate go files.
func PackageName ¶
PackageName determines the package name from sourceFile if it is within $GOPATH
func PartitionKV ¶ added in v2.0.1
PartitionKV partitions a reader then parses key-value meta using an assignment string.
Example ¶
PartitionKV(buf.NewBufferString(`
--@ key=SelectUser SELECT * FROM users;
`, "--@", "=") => [{"_kind": "key", "key": "SelectUser", "_body": "SELECT * FROM users;"}]
func PromptPassword ¶
PromptPassword prompts user for password input.
func StrTemplate ¶
StrTemplate reads a go template and writes it to dist given data.
Types ¶
This section is empty.