user

package
v0.0.0-...-3952f07 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 8 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(service Service) *Handler

func (*Handler) CreateUser

func (h *Handler) CreateUser(c echo.Context) error

type Repository

type Repository interface {
	CreateUser(ctx context.Context, user User) (User, error)
}

func NewRepository

func NewRepository(db *sql.DB) Repository

type Service

type Service interface {
	CreateUser(ctx context.Context, username, email, password, role string) (User, error)
}

func NewService

func NewService(repo Repository) Service

type User

type User struct {
	ID             int64     `json:"id"`
	Username       string    `json:"username"`
	Email          string    `json:"email"`
	HashedPassword string    `json:"-"`
	Role           string    `json:"role"`
	CreatedAt      time.Time `json:"created_at"`
}

Jump to

Keyboard shortcuts

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