utils

package
v0.1.6-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string.

func CreateIfNotExists

func CreateIfNotExists(path string, isDir bool) error

CreateIfNotExists creates a file or a directory only if it does not already exist.

func DecodeRawUnicodeEscape

func DecodeRawUnicodeEscape(s string) string

func IsExist

func IsExist(path string) bool

IsExist checks if a file or directory exists

func MakeDir

func MakeDir(dir string) error

func PtrTo

func PtrTo[T any](v T) *T

func RelToCwd

func RelToCwd(path string) string

func RemoveEmptyLine

func RemoveEmptyLine(s string) string

func RemoveIfExist

func RemoveIfExist(path string) error

func ReplaceSubscript

func ReplaceSubscript(s string) string

func ReplaceSuperscript

func ReplaceSuperscript(s string) string

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice.

func Truncate

func Truncate(filename string) error

Types

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

func NewRateLimiter

func NewRateLimiter(delay time.Duration) *RateLimiter

func (*RateLimiter) Stop

func (r *RateLimiter) Stop()

func (*RateLimiter) Wait

func (r *RateLimiter) Wait()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL