record

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Number uint8
	Line1  string
	Line2  string
}

Address defines a sub-document within Person.

type Person

type Person struct {
	ID          uint64    `bson:"_id"           json:"id"`
	Name        string    `bson:"name"          json:"name"`
	Address     []Address `bson:"addresses"     json:"addresses"`
	PhoneNumber string    `bson:"phone_number"  json:"phone_number"`
	DateOfBirth time.Time `bson:"dob"           json:"dob"`
	Age         uint32    `bson:"age"           json:"age"`
	Balance     float64   `bson:"balance"       json:"balance"`
	Enabled     bool      `bson:"enabled"       json:"enabled"`
	Counter     int32     `bson:"counter"       json:"counter"`
	Padding     []byte    `bson:"padding"       json:"padding"`
}

Person defines a semi-realistic data structure to be stored in the database.

Person was chosen to have a wide range of field types.

func (*Person) Randomise

func (p *Person) Randomise(rnd *rand.Rand)

Randomise uses rnd to populate p - existing data is overwrote.

Jump to

Keyboard shortcuts

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