internal

package
v0.0.0-...-a8d7802 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	Name        string   `json:"name"`
	Permissions []string `json:"permissions"`
}

type Storage

type Storage interface {
	CreateUser(ctx context.Context, user User) error
	GetUserByEmail(ctx context.Context, email string) (User, error)
}

type User

type User struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Role     Role   `json:"role"`
}

func (User) HasAccess

func (u User) HasAccess(permission string) bool

type UserService

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

func NewUserService

func NewUserService(storage Storage) *UserService

func (*UserService) CreateUser

func (s *UserService) CreateUser(ctx context.Context, user User) (User, error)

func (*UserService) GetUserByEmail

func (s *UserService) GetUserByEmail(ctx context.Context, email string) (User, error)

Directories

Path Synopsis
adapters
cmd
app
ports
ftp

Jump to

Keyboard shortcuts

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