user

package
v0.0.0-...-d81d3ea Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2016 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package user provides access to the user table in the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Get(dest interface{}, query string, args ...interface{}) error
	Select(dest interface{}, query string, args ...interface{}) error
}

Connection is an interface for making queries.

type Item

type Item struct {
	ID        uint32    `db:"id"`
	FirstName string    `db:"first_name"`
	LastName  string    `db:"last_name"`
	Email     string    `db:"email"`
	Password  string    `db:"password"`
	StatusID  uint8     `db:"status_id"`
	CreatedAt null.Time `db:"created_at"`
	UpdatedAt null.Time `db:"updated_at"`
	DeletedAt null.Time `db:"deleted_at"`
}

Item defines the model.

type Service

type Service struct {
	DB Connection
}

Service defines the database connection.

func (Service) ByEmail

func (c Service) ByEmail(email string) (Item, bool, error)

ByEmail gets user information from email.

func (Service) Create

func (c Service) Create(firstName, lastName, email, password string) (sql.Result, error)

Create creates user.

Jump to

Keyboard shortcuts

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