Documentation
¶
Overview ¶
Package util contains shared helpers used across the project, including:
- pointer and slice utilities (Deref, MapSlices, CopyNonNil),
- hashing helpers (HashWithPepper),
- simple validators for IDs/emails,
- simple sync/async task runners.
Index ¶
- func AnyBlank(strs ...string) bool
- func CopyNonNil[T any](items []*T) []T
- func Deref[T any](s *T) T
- func HashWithPepper(pepper, value string) string
- func IsLikelyChatID(s string) bool
- func IsLikelyEmail(s string) bool
- func IsLikelyGUID(s string) bool
- func IsLikelyThreadConversationID(s string) bool
- func MapSlices[T any, U any](items []T, mapper func(T) U) []U
- func MemberRole(isOwner bool) []string
- func Ptr[T any](v T) *T
- type AsyncRunner
- type SyncRunner
- type TaskRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyNonNil ¶
func CopyNonNil[T any](items []*T) []T
func HashWithPepper ¶
func IsLikelyChatID ¶
func IsLikelyEmail ¶
func IsLikelyGUID ¶
func MemberRole ¶
Types ¶
type AsyncRunner ¶
type AsyncRunner struct {
// contains filtered or unexported fields
}
func (*AsyncRunner) Run ¶
func (r *AsyncRunner) Run(fn func())
func (*AsyncRunner) Wait ¶
func (r *AsyncRunner) Wait()
type SyncRunner ¶
type SyncRunner struct{}
func (*SyncRunner) Run ¶
func (*SyncRunner) Run(fn func())
func (*SyncRunner) Wait ¶
func (*SyncRunner) Wait()
type TaskRunner ¶
type TaskRunner interface {
Run(fn func())
Wait()
}
Click to show internal directories.
Click to hide internal directories.