generator

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 6 Imported by: 0

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