example

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Base is a base type for database objects.

type User

type User struct {
	Base
	Email string
}

User is a database object.

type UserRepo

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

UserRepo represents the user repository.

func (*UserRepo) Get

func (rep *UserRepo) Get(ctx context.Context, id string) (*User, error)

Get will fetch a user.

func (*UserRepo) List

func (rep *UserRepo) List(ctx context.Context) ([]*User, error)

List will list a set of users.

func (*UserRepo) Save

func (rep *UserRepo) Save(ctx context.Context, u *User) error

Save a user.

Jump to

Keyboard shortcuts

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