Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(hostname, username, password, databaseName string) (*sqlx.DB, error)

NewDB creates new Postgres database handle.

Types

type Users

type Users struct {

	// contains filtered or unexported fields

}

Users implements store.Users interface.

func NewUsers

func NewUsers(db *sqlx.DB, opts ...UsersOption) *Users

NewUsers creates new users store.

func (*Users) FindByEmail

func (s *Users) FindByEmail(ctx context.Context, email string) (*model.User, error)

FindByEmail finds user by email address.

func (*Users) FindByID

func (s *Users) FindByID(ctx context.Context, id string) (*model.User, error)

FindByID finds user by id (UUID).

func (*Users) Insert

func (s *Users) Insert(ctx context.Context, u *model.User) error

Insert implements store.Users interface.

type UsersOption

type UsersOption func(*Users)

UsersOption ...

func UsersTableName

func UsersTableName(name string) UsersOption

UsersTableName ...

Source Files