user

package
v0.0.0-...-f040671 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 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 {
	ID           int
	FirstName    string
	LastName     string
	EmailAddress string
	Password     string
	IsActive     bool
}

User is a user model

func NewUser

func NewUser(fname, lname, email string) *User

func (*User) GetID

func (u *User) GetID() int

GetID helps satisfy the Entity interface

func (*User) SetID

func (u *User) SetID(id int)

SetID helps satisfy the Entity interface

func (*User) UpdatePassword

func (u *User) UpdatePassword(pass string)

type UserController

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

UserController implements the Controller interface for use with the standard library http package

func (*UserController) AddService

func (con *UserController) AddService(service webapp.Servicer)

AddService helps satisfy the Controller interface

func (*UserController) HandleBase

func (con *UserController) HandleBase() http.Handler

HandleBase helps satisfy the Controller interface

type UserRepository

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

UserRepository implements the Repository interface and provides methods for the service to use

func (*UserRepository) AddDataAccesser

func (repo *UserRepository) AddDataAccesser(dao webapp.DataAccesser)

AddDataAccesser helps satisfy the Repository interface

func (*UserRepository) AddUser

func (repo *UserRepository) AddUser(u *User) (int, error)

func (*UserRepository) Del

func (repo *UserRepository) Del(id int) error

func (*UserRepository) GetAllUsers

func (repo *UserRepository) GetAllUsers(ptr []*User) (int, error)

func (*UserRepository) GetUser

func (repo *UserRepository) GetUser(id int, ptr *User) error

func (*UserRepository) SetUser

func (repo *UserRepository) SetUser(u *User) error

type UserService

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

UserService implements the Servicer interface and provides methods for the controller to use

func (*UserService) AddNewUser

func (service *UserService) AddNewUser(r *http.Request) (int, error)

func (*UserService) AddRepository

func (service *UserService) AddRepository(repo webapp.Repository)

AddRepository helps satisfy the Servicer interface

func (*UserService) GetUser

func (service *UserService) GetUser(un, pw string) *User

type WiredUser

type WiredUser struct {
	*UserRepository
	*UserService
	*UserController
}

func WireUser

func WireUser(dao webapp.DataAccesser) *WiredUser

Jump to

Keyboard shortcuts

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