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 ¶
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 ¶
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 ¶
IsSignedInt is a check against the signed decimal types
func IsUnsignedInt ¶
IsUnsignedInt is a check against the unsigned integer types
func MessageItemsFromLines ¶
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 ¶
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 ¶
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 ¶
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.