Documentation ¶
Index ¶
- Variables
- func EmptyOr[T comparable](v T, def T) T
- func Filter[T comparable](tSlice []T, filter func(t T) bool) []T
- func GlobalID(material string) (id [8]byte)
- func ImmutableBytesFromString(s string) []byte
- func MapHash(material string) uint64
- func MustOK[T any](result T, ok bool) T
- func NewUUIDV1() uuid.UUID
- func NewUUIDV3(ns uuid.UUID, name string) uuid.UUID
- func NewUUIDV4() uuid.UUID
- func NewUUIDV5(ns uuid.UUID, name string) uuid.UUID
- func NewUUIDV6() uuid.UUID
- func NewUUIDV7() uuid.UUID
- func Reverse(s string) string
- func StringFromImmutableBytes(bs []byte) string
- func ToStringSlice(value any) ([]string, error)
- func UUIDMap(str string) (uuid.UUID, error)
- type IntRanges
- func NewSignedRanges[T constraints.Signed](expected string) (IntRanges[T], error)
- func NewSignedRangesFromList[T constraints.Signed](list []string) (IntRanges[T], error)
- func NewUnsignedRanges[T constraints.Unsigned](expected string) (IntRanges[T], error)
- func NewUnsignedRangesFromList[T constraints.Unsigned](list []string) (IntRanges[T], error)
- type Range
Constants ¶
This section is empty.
Variables ¶
View Source
var UnsafeUUIDGenerator = uuid.NewGenWithOptions(uuid.WithRandomReader(fastRandReader{}))
Functions ¶
func EmptyOr ¶
func EmptyOr[T comparable](v T, def T) T
func Filter ¶
func Filter[T comparable](tSlice []T, filter func(t T) bool) []T
func ImmutableBytesFromString ¶
ImmutableBytesFromString is equivalent to []byte(s), except that it uses the same memory backing s instead of making a heap-allocated copy. This is only valid if the returned slice is never mutated.
func StringFromImmutableBytes ¶
StringFromImmutableBytes is equivalent to string(bs), except that it uses the same memory backing bs instead of making a heap-allocated copy. This is only valid if bs is never mutated after StringFromImmutableBytes returns.
func ToStringSlice ¶
Types ¶
type IntRanges ¶
type IntRanges[T constraints.Integer] []Range[T]
func NewSignedRanges ¶
func NewSignedRanges[T constraints.Signed](expected string) (IntRanges[T], error)
func NewSignedRangesFromList ¶
func NewSignedRangesFromList[T constraints.Signed](list []string) (IntRanges[T], error)
func NewUnsignedRanges ¶
func NewUnsignedRanges[T constraints.Unsigned](expected string) (IntRanges[T], error)
func NewUnsignedRangesFromList ¶
func NewUnsignedRangesFromList[T constraints.Unsigned](list []string) (IntRanges[T], error)
type Range ¶
type Range[T constraints.Ordered] struct { // contains filtered or unexported fields }
func NewRange ¶
func NewRange[T constraints.Ordered](start, end T) Range[T]
func (Range[T]) LeftContains ¶
func (Range[T]) RightContains ¶
Click to show internal directories.
Click to hide internal directories.