Documentation
¶
Overview ¶
Package util haters gonna hate.
Index ¶
- func BasePath(s string) string
- func Camelcase(s string, v ...interface{}) string
- func ClearHeader(h http.Header)
- func Domain(s string) string
- func Env(m map[string]string) (env []string)
- func Exists(path string) bool
- func ExitStatus(cmd *exec.Cmd, err error) string
- func Fatal(err error)
- func Indent(s string) string
- func IsJSON(s string) bool
- func IsJSONLog(s string) bool
- func IsListening(u *url.URL) bool
- func IsNotFound(err error) bool
- func IsThrottled(err error) bool
- func Log(msg string, v ...interface{})
- func LogClear(msg string, v ...interface{})
- func LogListItem(msg string, v ...interface{})
- func LogName(name, msg string, v ...interface{})
- func LogPad(msg string, v ...interface{})
- func LogTitle(msg string, v ...interface{})
- func ManagedByUp(s string) string
- func Md5(s string) string
- func Milliseconds(d time.Duration) int
- func MillisecondsSince(t time.Time) int
- func NewInlineProgressInt(total int) *progress.Bar
- func NewProgressInt(total int) *progress.Bar
- func Pad() func()
- func ParseDuration(s string) (d time.Duration, err error)
- func ParseSections(r io.Reader) (sections []string, err error)
- func PrefixLines(s string, prefix string) string
- func ReadFileJSON(path string, v interface{}) error
- func StringsContains(list []string, s string) bool
- func ToFloat(v interface{}) float64
- func WaitForListen(u *url.URL, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Domain ¶
Domain returns the effective domain. For example the string "api.example.com" becomes "example.com", while "api.example.co.uk" becomes "example.co.uk".
func ExitStatus ¶
ExitStatus returns the exit status of cmd.
func IsListening ¶
IsListening returns true if there's a server listening on `u`.
func IsNotFound ¶
IsNotFound returns true if err is not nil and represents a missing resource.
func IsThrottled ¶
IsThrottled returns true if err is not nil and represents a throttled request.
func LogClear ¶
func LogClear(msg string, v ...interface{})
LogClear clears the line and outputs a log message.
func LogName ¶
func LogName(name, msg string, v ...interface{})
LogName outputs a log message with name.
func Milliseconds ¶
Milliseconds returns the duration as milliseconds.
func MillisecondsSince ¶
MillisecondsSince returns the duration as milliseconds relative to time t.
func NewInlineProgressInt ¶
func NewInlineProgressInt(total int) *progress.Bar
NewInlineProgressInt with the given total.
func NewProgressInt ¶
func NewProgressInt(total int) *progress.Bar
NewProgressInt with the given total.
func ParseDuration ¶
ParseDuration string with day and month approximation support.
func ParseSections ¶
ParseSections returns INI style sections from r.
func PrefixLines ¶
PrefixLines prefixes the lines in s with prefix.
func ReadFileJSON ¶
ReadFileJSON reads json from the given path.
func StringsContains ¶
StringsContains returns true if list contains s.
Types ¶
This section is empty.