gg_rnd

package
v0.2.102 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NUMBERS     = "1234567890"
	CHARSET     = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"
	CHARSET_LOW = "0123456789abcdefghijklmnopqrstuvwxyz"
	CHARSET_UP  = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
)

Functions

This section is empty.

Types

type RndHelper

type RndHelper struct {
	// contains filtered or unexported fields
}
var Rnd *RndHelper

func (*RndHelper) Between

func (instance *RndHelper) Between(min, max int64) int64

func (*RndHelper) BetweenDuration

func (instance *RndHelper) BetweenDuration(max, min int64) time.Duration

func (*RndHelper) Count

func (instance *RndHelper) Count(key ...string) int64

func (*RndHelper) Inc

func (instance *RndHelper) Inc(key ...string) int64

func (*RndHelper) NewValuesRandomizer

func (instance *RndHelper) NewValuesRandomizer(args ...interface{}) (*ValuesRandomizer, error)

func (*RndHelper) RndChars

func (instance *RndHelper) RndChars(n int) string

func (*RndHelper) RndCharsLower

func (instance *RndHelper) RndCharsLower(n int) string

func (*RndHelper) RndCharsUpper

func (instance *RndHelper) RndCharsUpper(n int) string

func (*RndHelper) RndDigits

func (instance *RndHelper) RndDigits(n int) string

func (*RndHelper) RndId

func (instance *RndHelper) RndId() string

func (*RndHelper) Uuid

func (instance *RndHelper) Uuid() string

Uuid creates a new random UUID or panics.

func (*RndHelper) UuidTimestamp

func (instance *RndHelper) UuidTimestamp() string

type ValuesRandomizer

type ValuesRandomizer struct {
	Params   *ValuesRandomizerParams
	Autosave bool
	// contains filtered or unexported fields
}

func NewValuesRandomizer

func NewValuesRandomizer(args ...interface{}) (instance *ValuesRandomizer, err error)

func (*ValuesRandomizer) GetDoneIndexes

func (instance *ValuesRandomizer) GetDoneIndexes() []int

func (*ValuesRandomizer) Map

func (instance *ValuesRandomizer) Map() map[string]interface{}

func (*ValuesRandomizer) Next

func (instance *ValuesRandomizer) Next() interface{}

func (*ValuesRandomizer) Save

func (instance *ValuesRandomizer) Save() (err error)

func (*ValuesRandomizer) SaveTo

func (instance *ValuesRandomizer) SaveTo(filename string) (err error)

func (*ValuesRandomizer) String

func (instance *ValuesRandomizer) String() string

type ValuesRandomizerParams

type ValuesRandomizerParams struct {
	Index  int           `json:"index,omitempty"`
	Values []interface{} `json:"values,omitempty"`
	Mode   string        `json:"mode,omitempty"` // one of "random" or "sequential"
}

func (*ValuesRandomizerParams) AddValue

func (instance *ValuesRandomizerParams) AddValue(value interface{}) *ValuesRandomizerParams

func (*ValuesRandomizerParams) Map

func (instance *ValuesRandomizerParams) Map() map[string]interface{}

func (*ValuesRandomizerParams) ResetValues

func (instance *ValuesRandomizerParams) ResetValues() *ValuesRandomizerParams

func (*ValuesRandomizerParams) SetValues

func (instance *ValuesRandomizerParams) SetValues(values []interface{}) *ValuesRandomizerParams

func (*ValuesRandomizerParams) String

func (instance *ValuesRandomizerParams) String() string

Jump to

Keyboard shortcuts

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