utils

package
v0.0.0-...-98550de Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMockTime = time.Now()
View Source
var Now = time.Now

Functions

func ArrayContains

func ArrayContains[T comparable](array []T, element T) bool

func DecodePageToken

func DecodePageToken(token string) (*time.Time, error)

func EncodePageToken

func EncodePageToken(lastMessageDate time.Time) string

func MockNow

func MockNow(t time.Time)

func StringSliceToUUIDSlice

func StringSliceToUUIDSlice(s ...string) ([]uuid.UUID, error)

func Unwrap

func Unwrap[T any](object interface{}) T

Unwrap

Safely casts object to [T].

We need this, because there's no way to check if [T] is [nil] prematurely, otherwise we fall into error trying to cast [nil] to [T].

Types

This section is empty.

Jump to

Keyboard shortcuts

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