user

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID                  string    `db:"id" json:"id"`
	Name                string    `db:"name" json:"name"`
	Email               string    `db:"email" json:"email"`
	PasswordHash        string    `db:"password_hash" json:"-"`
	PasswordAuthEnabled bool      `db:"password_auth_enabled" json:"password_auth_enabled"`
	Role                UserRole  `db:"role" json:"role"`
	CreatedAt           time.Time `db:"created_at" json:"created_at"`
	UpdatedAt           time.Time `db:"updated_at" json:"updated_at"`
}

type UserRepo

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

func NewUserRepo

func NewUserRepo(db *sqlx.DB) *UserRepo

func (*UserRepo) GetByEmail

func (r *UserRepo) GetByEmail(ctx context.Context, email string) (*User, error)

func (*UserRepo) GetByID

func (r *UserRepo) GetByID(ctx context.Context, id string) (*User, error)

type UserRole

type UserRole string
const (
	RoleSuperAdmin    UserRole = "super-admin"
	RoleProjectAdmin  UserRole = "project-admin"
	RoleProjectMember UserRole = "project-member"
	RoleProjectViewer UserRole = "project-viewer"
)

type UserService

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

func NewUserService

func NewUserService(repo *UserRepo) *UserService

func (*UserService) Authenticate

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

func (*UserService) GetByID

func (s *UserService) GetByID(ctx context.Context, id string) (*User, error)

Jump to

Keyboard shortcuts

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