user

package
v0.0.0-...-e1091f4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewController

func NewController(log *slog.Logger, service UserService) *ctrl

func NewDAO

func NewDAO(log *slog.Logger, timeout time.Duration, db *sqlx.DB) *dao

func NewService

func NewService(log *slog.Logger, orgSVC OrgSVC, dao UserDAO, txMGR TXManager, timer Timer, idGen IDGenerator) *service

Types

type CannotAssociateSysOrgErr

type CannotAssociateSysOrgErr struct {
	UserID string
	OrgID  string
}

func (CannotAssociateSysOrgErr) Error

func (err CannotAssociateSysOrgErr) Error() string

type CannotModifySysUserErr

type CannotModifySysUserErr struct {
	ID string
}

func (CannotModifySysUserErr) Error

func (err CannotModifySysUserErr) Error() string

type EmailAlreadyInUseErr

type EmailAlreadyInUseErr struct {
	Email string
}

func (EmailAlreadyInUseErr) Error

func (err EmailAlreadyInUseErr) Error() string

type IDGenerator

type IDGenerator interface {
	GenID() string
}

type NotFoundErr

type NotFoundErr struct {
	ID string
}

func (NotFoundErr) Error

func (err NotFoundErr) Error() string

type OptimisticLockErr

type OptimisticLockErr struct {
	ID      string
	Version int64
}

func (OptimisticLockErr) Error

func (err OptimisticLockErr) Error() string

type OrgSVC

type OrgSVC interface {
	GetByID(ctx context.Context, id string) (org.Org, error)
}

type TXManager

type TXManager interface {
	Do(ctx context.Context, tx *sqlx.Tx, f func(*sqlx.Tx) error) error
}

type Timer

type Timer interface {
	Now() time.Time
}

type UserDAO

type UserDAO interface {
	GetByID(ctx context.Context, id string) (user.User, error)
	GetAll(ctx context.Context) ([]user.User, error)
	GetAllByOrgID(ctx context.Context, orgID string) ([]user.User, error)
	Create(ctx context.Context, tx *sqlx.Tx, u user.User) error
	Update(ctx context.Context, tx *sqlx.Tx, u user.User) (user.User, error)
	Delete(ctx context.Context, tx *sqlx.Tx, u user.DeleteUser) error
}

type UserService

type UserService interface {
	GetByID(ctx context.Context, id string) (user.User, error)
	GetAll(ctx context.Context) ([]user.User, error)
	GetAllByOrgID(ctx context.Context, orgID string) ([]user.User, error)
	Save(ctx context.Context, u user.User) (user.User, error)
	Delete(ctx context.Context, u user.DeleteUser) error
}

Jump to

Keyboard shortcuts

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