Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombineList

func CombineList[T any](t ...[]T) []T

func GetUUIDv7 added in v0.1.9

func GetUUIDv7() uuid.UUID

func GetUUIDv7R added in v0.1.9

func GetUUIDv7R() mo.Result[uuid.UUID]

func IsEmpty added in v0.1.9

func IsEmpty(s string) bool

IsEmpty returns true if s is nil or contains only whitespace.

func IsNotEmpty added in v0.1.9

func IsNotEmpty(s string) bool

IsNotEmpty returns true if s has at least one non-whitespace character.

func ToByteArray

func ToByteArray(id uuid.UUID) []byte

func ToByteArrayPtr

func ToByteArrayPtr(id *uuid.UUID) *[]byte

func ToDateTime

func ToDateTime(milliSec int64) time.Time

func ToDateTimePtr

func ToDateTimePtr(milliSec *int64) *time.Time

func ToPtr

func ToPtr[T any](data T) *T

func ToString added in v0.1.4

func ToString[T any](v T) string

func ToUUID

func ToUUID(barray []byte) uuid.UUID

func ToUUIDPtr

func ToUUIDPtr(barray *[]byte) *uuid.UUID

func Uint64ToInt added in v0.1.9

func Uint64ToInt(u uint64) int

Uint64ToInt converts a uint64 to int, clamping to math.MaxInt to avoid overflow (e.g. for query params).

Types

type AlternateIdGenerator added in v0.1.9

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

func NewAlternateIdGenerator added in v0.1.9

func NewAlternateIdGenerator(length ...int) *AlternateIdGenerator

func (*AlternateIdGenerator) GenerateAlternateId added in v0.1.9

func (w *AlternateIdGenerator) GenerateAlternateId() mo.Result[string]

func (*AlternateIdGenerator) ValidateAlternateId added in v0.1.9

func (w *AlternateIdGenerator) ValidateAlternateId(s string) mo.Result[bool]

Jump to

Keyboard shortcuts

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