repo

package
v0.0.0-...-cc0c475 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

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

User repository

func NewUser

func NewUser(cb *gobreaker.CircuitBreaker, db *sqlx.DB) *User

NewUser create new user repository

func (*User) Create

func (u *User) Create(ctx context.Context, user *model.User) (*model.User, error)

Create insert new user into db

func (*User) FindByEmail

func (u *User) FindByEmail(ctx context.Context, email string) ([]model.User, error)

FindByEmail list users by email

func (*User) Get

func (u *User) Get(ctx context.Context, id string) (*model.User, error)

Get Get user by id

func (*User) GetByEmail

func (u *User) GetByEmail(ctx context.Context, email string) (*model.User, error)

GetByEmail Get user by email

func (*User) Update

func (u *User) Update(ctx context.Context, user *model.User) (*model.User, error)

Update update user

type UserRepo

type UserRepo interface {
	Create(ctx context.Context, user *model.User) (*model.User, error)
	Get(ctx context.Context, id string) (*model.User, error)
	GetByEmail(ctx context.Context, email string) (*model.User, error)
	FindByEmail(ctx context.Context, email string) ([]model.User, error)
	Update(ctx context.Context, user *model.User) (*model.User, error)
}

UserRepo User repository interface

Jump to

Keyboard shortcuts

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