fake

package
v0.0.0-...-b043d65 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fake provides random value generators for use in generated factory functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool() bool

Bool returns a random bool.

func Bytes

func Bytes(n int) []byte

Bytes returns n random bytes.

func Float32

func Float32() float32

Float32 returns a random float32 in [0.01, 1000.0).

func Float64

func Float64() float64

Float64 returns a random float64 in [0.01, 1000.0).

func Int16

func Int16() int16

Int16 returns a random int16 in [1, 32000].

func Int32

func Int32() int32

Int32 returns a random int32 in [1, 2_000_000].

func Int64

func Int64() int64

Int64 returns a random int64 in [1, 2_000_000_000].

func JSON

func JSON() json.RawMessage

JSON returns a minimal valid JSON object.

func Numeric

func Numeric() string

Numeric returns a random decimal string (for numeric/money columns).

func Ptr

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

Ptr returns a pointer to the given value.

func String

func String(prefix string) string

String returns a random string with the given prefix.

func Time

func Time() time.Time

Time returns a random time in the last 365 days, truncated to microseconds (Postgres precision).

func UUID

func UUID() string

UUID returns a random UUID v4 string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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