import "code.gitea.io/gitea/modules/base"
base.go natural_sort.go tool.go
const SVGMimeType = "image/svg+xml"
SVGMimeType MIME type of SVG images.
const TimeLimitCodeLength = 12 + 6 + 40
TimeLimitCodeLength default value for time limit code
BasicAuthDecode decode basic auth string
BasicAuthEncode encode basic auth string
CreateTimeLimitCode create a time limit code code format: 12 length date time string + 6 minutes string + 40 sha1 encoded string
DetectContentType extends http.DetectContentType with more content types.
EllipsisString returns a truncated short string, it appends '...' in the end of the length of string is too large.
EncodeMD5 encodes string to md5 hex value.
EncodeSha1 string to sha1 hex value.
EncodeSha256 string to sha1 hex value.
EntryIcon returns the octicon class for displaying files/directories
FileSize calculates the file size and generate user-friendly string.
FormatNumberSI format a number
Int64sContains returns if a int64 in a slice of int64
Int64sToMap converts a slice of int64 to a int64 map.
Int64sToStrings converts a slice of int64 to a slice of string.
IsAudioFile detects if data is an video format
IsImageFile detects if data is an image format
IsLetter reports whether the rune is a letter (category L). https://github.com/golang/go/blob/master/src/go/scanner/scanner.go#L257
IsPDFFile detects if data is a pdf format
IsRepresentableAsText returns true if file content can be represented as plain text or is empty.
IsSVGImageFile detects if data is an SVG image format
IsTextFile returns true if file content format is plain text or empty.
IsVideoFile detects if data is an video format
NaturalSortLess compares two strings so that they could be sorted in natural order
PrettyNumber produces a string form of the given number in base 10 with commas after every three orders of magnitud
SetupGiteaRoot Sets GITEA_ROOT if it is not already set and returns the value
ShortSha is basically just truncating. It is DEPRECATED and will be removed in the future.
StringsToInt64s converts a slice of string to a slice of int64.
func Subtract(left interface{}, right interface{}) interface{}
Subtract deals with subtraction of all types of number.
TruncateString returns a truncated string with given limit, it returns input string if length is not reached limit.
VerifyTimeLimitCode verify time limit code
TplName template relative path type
Package base imports 22 packages (graph) and is imported by 378 packages. Updated 2021-01-22. Refresh now. Tools for package owners.