Documentation ¶
Index ¶
- Variables
- func DocsURL(path string) string
- func Ellipsis(text string, maxLength int) 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) (batches [][]t.MessageItem)
- 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 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 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 Ellipsis ¶ added in v0.6.0
Ellipsis returns a string that is at most maxLength characters with a ellipsis appended if the input was longer
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) (batches [][]t.MessageItem)
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 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.