random

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateTimeInRangeZero

func DateTimeInRangeZero() reflect.Type

DateTimeInRangeZero ...

func DateZero

func DateZero() reflect.Type

DateZero ...

func DecimalZero

func DecimalZero() reflect.Type

DecimalZero ...

func FoldContains

func FoldContains(s, sub string) bool

FoldContains tells if s contains sub in fold mode.

func IntZero

func IntZero() reflect.Type

IntZero ...

func RandInt

func RandInt(r *rand.Rand, min, max int32) int32

RandInt ...

func StrZero

func StrZero() reflect.Type

StrZero ...

func TimeZero

func TimeZero() reflect.Type

TimeZero ...

Types

type Date

type Date struct {
}

Date structured a date randomizer.

func NewRandomDate

func NewRandomDate(_ model.TableColumn) *Date

NewRandomDate ...

func (*Date) Value

func (r *Date) Value() interface{}

Value ... nolint gomnd

type DateTimeInRange

type DateTimeInRange struct{}

DateTimeInRange ...

func NewRandomDateTime

func NewRandomDateTime() *DateTimeInRange

NewRandomDateTime returns a new random datetime between Now() and Now() - 1 year

func (*DateTimeInRange) Value

func (r *DateTimeInRange) Value() interface{}

Value returns a random time.Time in the range specified by the New method

type Decimal

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

Decimal holds unexported data for decimal values

func NewRandomDecimal

func NewRandomDecimal(column model.TableColumn, size int) *Decimal

NewRandomDecimal ...

func (*Decimal) Value

func (r *Decimal) Value() interface{}

Value ...

type Fn

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

Fn ...

func NewFn

func NewFn(fn func() interface{}) *Fn

NewFn ...

func (*Fn) Value

func (r *Fn) Value() interface{}

Value ...

type Int

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

Int ...

func NewRandomInt

func NewRandomInt(col model.TableColumn, mask int64) *Int

NewRandomInt ...

func (Int) Value

func (r Int) Value() interface{}

Value ...

type RuneRandom

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

RuneRandom ...

func MakeRuneRandom

func MakeRuneRandom() *RuneRandom

MakeRuneRandom ...

func (*RuneRandom) Rune

func (rr *RuneRandom) Rune(maxSize int) string

Rune ... nolint gomnd

type Str

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

Str ...

func NewRandomStr

func NewRandomStr(column model.TableColumn) *Str

NewRandomStr ...

func (*Str) Value

func (r *Str) Value() interface{}

Value ... nolint gomnd

type Time

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

Time ...

func NewRandomTime

func NewRandomTime(column model.TableColumn) *Time

NewRandomTime ...

func (*Time) Value

func (r *Time) Value() interface{}

Value ... nolint gomnd

Jump to

Keyboard shortcuts

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