Documentation ¶
Index ¶
- func BytesToString(b []byte) string
- func CamelToSnake(name string) string
- func CondenseEmptyLines(s string) string
- func CreateIfNotExists(path string, isDir bool) error
- func DecodeRawUnicodeEscape(s string) string
- func EnsureTrailingNewline(s string) string
- func IsExist(path string) bool
- func MakeDir(dir string) error
- func RelToCwd(path string) string
- func RemoveDirIfExist(path string) error
- func RemoveIfExist(path string) error
- func ReplaceSubscript(s string) string
- func ReplaceSuperscript(s string) string
- func SplitLines(s string) []string
- func StringToBytes(s string) []byte
- func Truncate(filename string) error
- func TruncateString(s string, n int) string
- func WriteFile(file string, content []byte) error
- type RateLimiter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to string.
func CamelToSnake ¶ added in v1.3.1
func CondenseEmptyLines ¶ added in v0.2.2
CondenseEmptyLines condenses multiple consecutive empty lines in a string to a single empty line, while preserving non-empty lines.
func CreateIfNotExists ¶
CreateIfNotExists creates a file or a directory only if it does not already exist.
func DecodeRawUnicodeEscape ¶
func EnsureTrailingNewline ¶ added in v0.2.2
func RemoveDirIfExist ¶ added in v1.4.2
func RemoveIfExist ¶
func ReplaceSubscript ¶
func ReplaceSuperscript ¶
func SplitLines ¶ added in v1.3.1
SplitLines splits a string into lines by '\n' or '\r\n'.
func StringToBytes ¶
StringToBytes converts string to byte slice.
func TruncateString ¶ added in v1.3.12
TruncateString shortens a string longer than n by replacing the middle part with "...<truncated>..."
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(per time.Duration) *RateLimiter
func (*RateLimiter) Take ¶ added in v0.2.1
func (r *RateLimiter) Take()
Click to show internal directories.
Click to hide internal directories.