repo

package
v0.0.0-...-0d0896c Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 6 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(db *sqlx.DB) *User

NewUser create new user repository

func (*User) BulkInsert

func (u *User) BulkInsert(ctx context.Context, users []*model.User) error

BulkInsert bulk insert user

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

type UserRepo

type UserRepo interface {
	BulkInsert(ctx context.Context, users []*model.User) error
	Create(ctx context.Context, user *model.User) (*model.User, error)
	FindByEmail(ctx context.Context, email string) ([]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