user

package
v0.0.0-...-f80c191 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(
	store types.UserStore,
	hashPassword func(password string) (string, error),
	comparePassword func(hashed string, plain string) bool,
	createJwtToken func(secret []byte, userId int) (string, error),
) *Handler

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(router *mux.Router)

type Store

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

func NewStore

func NewStore(db *sql.DB) *Store

func (*Store) CreateUser

func (s *Store) CreateUser(user types.User) (int, error)

func (*Store) GetUserByEmail

func (s *Store) GetUserByEmail(email string) (*types.User, error)

func (*Store) GetUserByID

func (s *Store) GetUserByID(id int) (*types.User, error)

func (*Store) GetUsers

func (s *Store) GetUsers() ([]types.User, error)

Jump to

Keyboard shortcuts

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