Documentation ¶
Index ¶
- Variables
- func CeilDiv(dividend int, divisor int) int
- func DocsURL(path string) string
- func IsCollection(kind reflect.Kind) bool
- func IsNumeric(kind reflect.Kind) bool
- func IsSignedInt(kind reflect.Kind) bool
- func IsUnsignedInt(kind reflect.Kind) bool
- func Max(a int, b int) int
- func MessageItemsFromLines(plain string, limits t.MessageLimit) (items []t.MessageItem, omitted int)
- func Min(a int, b int) int
- func PartitionMessage(input string, limits t.MessageLimit, distance int) (items []t.MessageItem, omitted int)
- func StripNumberPrefix(input string) (number string, base int)
- func TestLogger() *log.Logger
- func URLMust(rawURL string) *url.URL
- func URLUserPassword(user, password string) *url.Userinfo
Constants ¶
This section is empty.
Variables ¶
var DiscardLogger = log.New(ioutil.Discard, "", 0)
DiscardLogger is a logger that discards any output written to it
Functions ¶
func CeilDiv ¶ added in v0.4.0
CeilDiv returns the quotient from dividing the dividend with the divisor, but rounded up to the nearest integer
func DocsURL ¶ added in v0.5.0
DocsURL returns a full documentation URL for the current version of Shoutrrr with the path appended. If the path contains a leading slash, it is stripped.
func IsCollection ¶
IsCollection is a check against slice and array
func IsSignedInt ¶ added in v0.4.0
IsSignedInt is a check against the signed decimal types
func IsUnsignedInt ¶ added in v0.4.0
IsUnsignedInt is a check against the unsigned integer types
func MessageItemsFromLines ¶ added in v0.4.0
func MessageItemsFromLines(plain string, limits t.MessageLimit) (items []t.MessageItem, omitted int)
MessageItemsFromLines creates a set of MessageItems that is compatible with the supplied limits
func PartitionMessage ¶ added in v0.4.0
func PartitionMessage(input string, limits t.MessageLimit, distance int) (items []t.MessageItem, omitted int)
PartitionMessage splits a string into chunks that is at most chunkSize runes, it will search the last distance runes for a whitespace to make the split appear nicer. It will keep adding chunks until it reaches maxCount chunks, or if the total amount of runes in the chunks reach maxTotal. The chunks are returned together with the number of omitted runes (that did not fit into the chunks)
func StripNumberPrefix ¶ added in v0.4.0
StripNumberPrefix returns a number string with any base prefix stripped and it's corresponding base If no prefix was found, returns 0 to let strconv try to identify the base
func TestLogger ¶
TestLogger returns a log.Logger that writes to ginkgo.GinkgoWriter for use in tests
func URLUserPassword ¶ added in v0.4.2
URLUserPassword is a replacement/wrapper around url.UserPassword that treats empty string arguments as not specified If no user or password is specified, it returns nil (which serializes in url.URL to "")
Types ¶
This section is empty.