util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyBlank

func AnyBlank(strs ...string) bool

func CopyNonNil

func CopyNonNil[T any](items []*T) []T

func Deref

func Deref[T any](s *T) T

func HashWithPepper

func HashWithPepper(pepper, value string) string

func IsLikelyChatID

func IsLikelyChatID(s string) bool

func IsLikelyEmail

func IsLikelyEmail(s string) bool

func IsLikelyGUID

func IsLikelyGUID(s string) bool

func IsLikelyThreadConversationID

func IsLikelyThreadConversationID(s string) bool

func MapSlices

func MapSlices[T any, U any](items []T, mapper func(T) U) []U

func MemberRole

func MemberRole(isOwner bool) []string

func Ptr

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

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()
}

Jump to

Keyboard shortcuts

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