accountrepo

package
v0.0.0-...-9b8bc8a Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicatedUser = rerror.NewE(i18n.T("duplicated user"))
View Source
var (
	ErrOperationDenied = rerror.NewE(i18n.T("operation denied"))
)

Functions

This section is empty.

Types

type Container

type Container struct {
	User        User
	Workspace   Workspace
	Transaction usecasex.Transaction
	Users       []User
}

func (*Container) Filtered

func (c *Container) Filtered(workspace WorkspaceFilter) *Container

type MultiUser

type MultiUser []User

func NewMultiUser

func NewMultiUser(users ...User) MultiUser

func (MultiUser) Create

func (u MultiUser) Create(ctx context.Context, user *user.User) error

func (MultiUser) FindAll

func (u MultiUser) FindAll(ctx context.Context) (user.List, error)

func (MultiUser) FindByEmail

func (u MultiUser) FindByEmail(ctx context.Context, email string) (*user.User, error)

func (MultiUser) FindByID

func (u MultiUser) FindByID(ctx context.Context, id user.ID) (*user.User, error)

func (MultiUser) FindByIDs

func (u MultiUser) FindByIDs(ctx context.Context, ids user.IDList) (user.List, error)

func (MultiUser) FindByName

func (u MultiUser) FindByName(ctx context.Context, name string) (*user.User, error)

func (MultiUser) FindByNameOrEmail

func (u MultiUser) FindByNameOrEmail(ctx context.Context, nameOrEmail string) (*user.User, error)

func (MultiUser) FindByPasswordResetRequest

func (u MultiUser) FindByPasswordResetRequest(ctx context.Context, p string) (*user.User, error)

func (MultiUser) FindBySub

func (u MultiUser) FindBySub(ctx context.Context, sub string) (*user.User, error)

func (MultiUser) FindBySubOrCreate

func (u MultiUser) FindBySubOrCreate(ctx context.Context, v *user.User, s string) (*user.User, error)

func (MultiUser) FindByVerification

func (u MultiUser) FindByVerification(ctx context.Context, v string) (*user.User, error)

func (MultiUser) Remove

func (u MultiUser) Remove(ctx context.Context, id user.ID) error

func (MultiUser) Save

func (u MultiUser) Save(ctx context.Context, user *user.User) error

func (MultiUser) SearchByKeyword

func (u MultiUser) SearchByKeyword(ctx context.Context, keyword string) (user.List, error)

type User

type User interface {
	UserQuery
	FindByVerification(context.Context, string) (*user.User, error)
	FindByPasswordResetRequest(context.Context, string) (*user.User, error)
	FindBySubOrCreate(context.Context, *user.User, string) (*user.User, error)
	Create(context.Context, *user.User) error
	Save(context.Context, *user.User) error
	Remove(context.Context, user.ID) error
}

type UserQuery

type UserQuery interface {
	FindAll(context.Context) (user.List, error)
	FindByID(context.Context, user.ID) (*user.User, error)
	FindByIDs(context.Context, user.IDList) (user.List, error)
	FindBySub(context.Context, string) (*user.User, error)
	FindByEmail(context.Context, string) (*user.User, error)
	FindByName(context.Context, string) (*user.User, error)
	FindByNameOrEmail(context.Context, string) (*user.User, error)
	SearchByKeyword(context.Context, string) (user.List, error)
}

type WorkspaceFilter

type WorkspaceFilter struct {
	Readable accountdomain.WorkspaceIDList
	Writable accountdomain.WorkspaceIDList
}

func WorkspaceFilterFromOperator

func WorkspaceFilterFromOperator(o *accountusecase.Operator) WorkspaceFilter

func (WorkspaceFilter) CanRead

func (WorkspaceFilter) CanWrite

func (WorkspaceFilter) Clone

func (f WorkspaceFilter) Clone() WorkspaceFilter

func (WorkspaceFilter) Filter

func (f WorkspaceFilter) Filter(q any) any

func (WorkspaceFilter) Merge

Jump to

Keyboard shortcuts

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