randomize

package
v2.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2016 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Overview

Package randomize has helpers for randomization of structs and fields

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StableDBName

func StableDBName(input string) string

StableDBName takes a database name in, and generates a random string using the database name as the rand Seed. getDBNameHash is used to generate unique test database names.

func Struct

func Struct(s *Seed, str interface{}, colTypes map[string]string, canBeNull bool, blacklist ...string) error

Struct gets its fields filled with random data based on the seed. It will ignore the fields in the blacklist. It will ignore fields that have the struct tag boil:"-"

Types

type Seed

type Seed int64

Seed is an atomic counter for pseudo-randomization structs. Using full randomization leads to collisions in a domain where uniqueness is an important factor.

func NewSeed

func NewSeed() *Seed

NewSeed creates a new seed for pseudo-randomization.

Jump to

Keyboard shortcuts

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