reggen

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package reggen generates text based on regex definitions based on the reggen library by Lucas Jones https://github.com/lucasjones/reggen/blob/master/reggen.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(regex string, limit int) (string, error)

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(regex string) (*Generator, error)

create a new generator

func (*Generator) Generate

func (g *Generator) Generate(limit int) string

limit is the maximum number of times star, range or plus should repeat i.e. [0-9]+ will generate at most 10 characters if this is set to 10

func (*Generator) SetSeed

func (g *Generator) SetSeed(seed int64)

Jump to

Keyboard shortcuts

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