service

package
v0.0.0-...-dd9f884 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserService

func NewUserService(repo repository.UserRepository) userService

Types

type User

type User struct {
	Username string `json:"username"`
	Password string `json:"password"`
	FullName string `json:"fullname"`
	Email    string `json:"email"`
	Role     string `json:"role"`
}

type UserDetail

type UserDetail struct {
	Id           string    `json:"id"`
	Username     string    `json:"username"`
	FullName     string    `json:"fullname"`
	Email        string    `json:"email"`
	Role         string    `json:"role"`
	AutoDatetime time.Time `json:"auto_datetime"`
}

type UserService

type UserService interface {
	Register(User) (string, error)
	GetAllUsers() ([]UserDetail, error)
	GetUserById(string) (*UserDetail, error)
	UpdateUser(UserDetail) (string, error)
	DeleteUser(string) error
}

Jump to

Keyboard shortcuts

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