generator

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct{}

Generator is responsible for randomly generating new strings and tokens that might need to be mocked out to produce consistent output for tests

func New

func New() *Generator

New returns a new Generator

func (*Generator) PSK

func (g *Generator) PSK() ([]byte, error)

PSK returns a new random array of 16 bytes

func (*Generator) Timestamp

func (g *Generator) Timestamp() time.Time

Timestamp generates a timestamp of the current time

func (*Generator) URL

func (g *Generator) URL(host, path string, args ...interface{}) string

URL generates a URL from a host and a path made from a printf string + arguments

func (*Generator) UUID

func (g *Generator) UUID() (uuid.UUID, error)

UUID generates a new V4 UUID

func (*Generator) UniqueTimestamp

func (g *Generator) UniqueTimestamp() primitive.Timestamp

UniqueTimestamp generates a timestamp of the current time in the special format required by mongoDB

Jump to

Keyboard shortcuts

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