example

package
v0.0.0-...-069085c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 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 ContactInfo

type ContactInfo struct {
	Email         string
	EmailVerified bool
}

ContactInfo is a internal struct for user.

type Generator

type Generator struct {
	some.Generator
}

Generator is a generator for example.

func (*Generator) User

func (s *Generator) User(key string, spec UserSpec) *User

User generate example random user from a key.

type KVS

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

KVS is a example store for user.

func (*KVS) Get

func (kvs *KVS) Get(id int64) *User

Get finds user by id.

type Some

type Some struct {
	some.Some
}

func (Some) User

func (s Some) User() UserSpec

type User

type User struct {
	ID          int64
	Name        string
	ContactInfo ContactInfo
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

User is a example struct.

type UserSpec

type UserSpec struct {
	ID int64
}

func (UserSpec) CacheKey

func (s UserSpec) CacheKey() string

func (UserSpec) Generate

func (s UserSpec) Generate(r *rand.Rand) User

SomeUser user generate a example random use from rand.

func (UserSpec) WithID

func (s UserSpec) WithID(id int64) UserSpec

Jump to

Keyboard shortcuts

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