faker

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type GeneralConstraint

type GeneralConstraint struct {
	SkipChance float64 `yaml:"skipChance"`
}

func (*GeneralConstraint) Validate

func (gc *GeneralConstraint) Validate() error

type NumericConstraint

type NumericConstraint struct {
	Min float64 `yaml:"min"`
	Max float64 `yaml:"max"`
}

func (*NumericConstraint) Validate

func (nc *NumericConstraint) Validate() error

type Source

type Source string
var (
	TypeFirstName Source = "FIRST_NAME"
	TypeLastName  Source = "LAST_NAME"
	TypeEmail     Source = "EMAIL"
	TypeUUID      Source = "UUID"
	TypeTimestamp Source = "TIMESTAMP"
	TypeInt       Source = "INTEGER"
	TypeString    Source = "STRING"
	TypeBool      Source = "BOOL"
	TypeCompany   Source = "COMPANY"
	TypePhone     Source = "PHONE"
	TypeStreet    Source = "STREET"
	TypeCity      Source = "CITY"
	TypeState     Source = "STATE"
	TypeZip       Source = "ZIP"
	TypeCountry   Source = "COUNTRY"
	TypeMonth     Source = "MONTH"
	TypeBeerName  Source = "BEER_NAME"
	TypeBeerStyle Source = "BEER_STYLE"
	TypeYesNo     Source = "YES_NO"

	// The list of "faker" values the application supports.
	// Note: This is just a subset of the fakers available in https://github.com/brianvoe/gofakeit
	//       in addition to custom ones.
	AllSources = []Source{
		TypeFirstName, TypeLastName, TypeBool, TypeEmail,
		TypeUUID, TypeTimestamp, TypeInt, TypeString,
		TypeBool, TypePhone, TypeStreet, TypeZip, TypeCompany,
		TypeMonth, TypeBeerName, TypeBeerStyle, TypeCity,
		TypeState, TypeYesNo, TypeCountry,
	}
)

type StringConstraint

type StringConstraint struct {
	Regex string   `yaml:"regex"`
	OneOf []string `yaml:"oneOf"`
}

func (*StringConstraint) Validate

func (sc *StringConstraint) Validate() error

type TimestampConstraint

type TimestampConstraint struct {
	Start  time.Time `yaml:"after"`
	End    time.Time `yaml:"before"`
	Format string    `yaml:"format"`
}

func (*TimestampConstraint) Validate

func (tc *TimestampConstraint) Validate() error

Jump to

Keyboard shortcuts

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