generators

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 25 Imported by: 0 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

Overview

Package generators groups the tools that generate values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash struct{}

Hash computes hashes and HMACs of the input.

func (Hash) Run

func (h Hash) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (Hash) Spec

func (Hash) Spec() tool.Spec

type Lorem added in v0.2.0

type Lorem struct {
	Rand io.Reader
}

Lorem generates Lorem Ipsum placeholder text. Rand pins the randomness in tests; when nil, crypto/rand seeds the generator.

func (Lorem) Run added in v0.2.0

func (l Lorem) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (Lorem) Spec added in v0.2.0

func (Lorem) Spec() tool.Spec

type Password added in v0.2.0

type Password struct {
	Rand io.Reader
}

Password generates random passwords. Rand pins the randomness in tests; when nil, crypto/rand is used.

func (Password) Run added in v0.2.0

func (p Password) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (Password) Spec added in v0.2.0

func (Password) Spec() tool.Spec

type UUID

type UUID struct {
	Now  func() time.Time
	Rand io.Reader
}

UUID generates UUID v4/v7 and ULID, or inspects an existing one. Now and Rand pin the clock and randomness in tests; when nil, time.Now and crypto/rand are used.

func (UUID) Detect

func (UUID) Detect(sample string) float64

Detect recognises a canonical UUID (8-4-4-4-12).

func (UUID) Run

func (u UUID) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (UUID) Spec

func (UUID) Spec() tool.Spec

Jump to

Keyboard shortcuts

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