model

package
v0.0.0-...-4e80387 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateUserName = errors.New("Username already exists")
)

Functions

func CloseDB

func CloseDB()

func InitDB

func InitDB(dataSourceName string) error

Types

type User

type User struct {
	ID         int     `json:"user_id"`
	UserName   *string `json:"user_name"`
	FirstName  *string `json:"first_name"`
	LastName   *string `json:"last_name"`
	Email      *string `json:"email"`
	Status     *string `json:"user_status"`
	Department *string `json:"department"`
}

func (*User) Create

func (u *User) Create() (User, error)

func (*User) Delete

func (u *User) Delete(id int) error

func (*User) GetAllUsers

func (u *User) GetAllUsers() ([]User, error)

func (*User) Update

func (u *User) Update(id int) error

type UserModel

type UserModel interface {
	GetAllUsers() ([]User, error)
	Create() (User, error)
	Update(id int) error
	Delete(id int) error
}

Jump to

Keyboard shortcuts

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