randx

package
v0.0.0-...-11273d6 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenUUID

func GenUUID(name string) string

export

func GetBytes

func GetBytes(n int) ([]byte, error)

func GetInt

func GetInt(n int) int

export

func GetString

func GetString(s int) (string, error)

func GetUUID

func GetUUID(name string) string

export

Types

type CharPool

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

func NewCharPool

func NewCharPool(css ...*CharSource) *CharPool

func (CharPool) Get

func (cp CharPool) Get(length int) string

type CharSource

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

func NewCharSource

func NewCharSource(text string, weight int) *CharSource

func (CharSource) Get

func (cs CharSource) Get() interface{}

func (CharSource) Weight

func (cs CharSource) Weight() int

type Generator

type Generator interface {
	Get() interface{}
}

type Pool

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

func NewPool

func NewPool(params ...interface{}) *Pool

func (*Pool) Get

func (p *Pool) Get() interface{}

func (*Pool) RandInt

func (p *Pool) RandInt(n int) int

func (*Pool) ResetIndex

func (p *Pool) ResetIndex()

type Source

type Source interface {
	Generator
	Weight() int
}

type Source1

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

func (*Source1) Get

func (s *Source1) Get() interface{}

func (Source1) Weight

func (s Source1) Weight() int

Jump to

Keyboard shortcuts

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