user

package
v0.0.0-...-7428172 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound         = errors.New("user not found")
	ErrInvalidUUID      = errors.New("UUID is not valid")
	ErrInvalidEmail     = errors.New("email is not valid")
	ErrNotAuthenticated = errors.New("user not authenticated")
)

Functions

This section is empty.

Types

type Core

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

Core manages the set of APIs for user access. Notes: Core does not maintain any state, we should use value semantic. Core is responsible for validating user data. Core is responsible for persisting user data.

func NewCore

func NewCore(sqlDB *sqlx.DB, logger *zap.SugaredLogger) Core

NewCore constructs a Core for user api access.

func (Core) Authenticate

func (c Core) Authenticate(ctx context.Context, email, pass string) (auth.Claims, error)

func (Core) QueryByUUID

func (c Core) QueryByUUID(ctx context.Context, uuid string) (User, error)

type User

type User struct {
	UUID        string
	Email       string
	Permissions []string
}

User is a business representation of the user entity.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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