randstring

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Source *rand.Source
	Bucket string
}

Config is the config of RandString

type RandString

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

RandString is a source of random strings

func New

func New(cfg *Config) (*RandString, error)

New create a random string generator

func (*RandString) AddBucket

func (r *RandString) AddBucket(bucket string) error

AddBucket add additional bucket to current bucket and calculate bucket related values

func (*RandString) AddLowerLetterBucket

func (r *RandString) AddLowerLetterBucket() error

AddLowerLetterBucket add lower letters to current bucket and calculate bucket related values

func (*RandString) AddNumberBucket

func (r *RandString) AddNumberBucket() error

AddNumberBucket add numbers to current bucket and calculate bucket related values

func (*RandString) AddSpecialCharacterBucket

func (r *RandString) AddSpecialCharacterBucket() error

AddSpecialCharacterBucket add special characters to current bucket and calculate bucket related values

func (*RandString) AddUpperLetterBucket

func (r *RandString) AddUpperLetterBucket() error

AddUpperLetterBucket add upper letters to current bucket and calculate bucket related values

func (*RandString) Get

func (r *RandString) Get(n int) (string, error)

Get generates a random string

func (*RandString) GetBucket

func (r *RandString) GetBucket() string

GetBucket get current bucket

func (*RandString) SetBucket

func (r *RandString) SetBucket(bucket string) error

SetBucket set the bucket and calculate bucket related values

Jump to

Keyboard shortcuts

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