testutils

package
v0.0.0-...-ce3407c Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key, defaultValue string) string

GetEnv returns the value of the environment variable or the default value if not set

func GetRedisNamespace

func GetRedisNamespace() string

GetRedisNamespace returns the Redis namespace prefix for tests

func RandomTime

func RandomTime() time.Time

RandomTime returns a random time for testing

func RandomUUID

func RandomUUID() uuid.UUID

RandomUUID returns a new random UUID for testing

func ReadMigrationSQL

func ReadMigrationSQL(t *testing.T) string

func StringPtr

func StringPtr(s string) *string

StringPtr returns a pointer to the given string

func TestDB

func TestDB(t testing.TB) *sqlx.DB

TestDB creates a test database and returns a connection to it

func TestRedis

func TestRedis(t *testing.T) *redis.Client

TestRedis returns a Redis client for testing

Types

This section is empty.

Jump to

Keyboard shortcuts

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