internal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReNoPath = regexp2.MustCompile(reNoPathExpr, reOptions)

Functions

func Bytes

func Bytes(s string) []byte

Bytes converts string to byte slice without a memory allocation. For more details, see https://github.com/golang/go/issues/53003#issuecomment-1140276077.

func Filter

func Filter[T any](collection []T, callback func(item T) bool) []T

func FilterMap

func FilterMap[T any, R any](collection []T, callback func(item T) (R, bool)) []R

func Map

func Map[T any, R any](collection []T, iteratee func(item T) R) []R

func Must

func Must[T any](value T, err error) T

func NewChaCha8

func NewChaCha8() *rand.ChaCha8

func Ptr

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

func RandomString

func RandomString(length int) string

RandomString generates a cryptographically random string with the specified length.

The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.

func RandomStringWithAlphabet

func RandomStringWithAlphabet(length int, alphabet string) string

RandomStringWithAlphabet generates a cryptographically random string with the specified length and characters set.

func Regexp

func Regexp(expr string) (*regexp2.Regexp, bool)

func RegexpPath

func RegexpPath(path string) (*regexp2.Regexp, error)

func String

func String(b []byte) string

String converts byte slice to string without a memory allocation. For more details, see https://github.com/golang/go/issues/53003#issuecomment-1140276077.

func ToInt64

func ToInt64(s string) int64

func Unique

func Unique[S ~[]E, E comparable](s S) S

Types

This section is empty.

Jump to

Keyboard shortcuts

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