2022-06-28 07:32:25 -05:00
|
|
|
package user
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2023-04-18 08:34:40 -05:00
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/registry"
|
2022-06-28 07:32:25 -05:00
|
|
|
)
|
|
|
|
|
2024-03-12 03:35:13 -05:00
|
|
|
//go:generate mockery --name Service --structname MockService --outpkg usertest --filename mock.go --output ./usertest/
|
2022-06-28 07:32:25 -05:00
|
|
|
type Service interface {
|
2023-04-18 08:34:40 -05:00
|
|
|
registry.ProvidesUsageStats
|
2022-06-28 07:32:25 -05:00
|
|
|
Create(context.Context, *CreateUserCommand) (*User, error)
|
2022-12-07 10:03:22 -06:00
|
|
|
CreateServiceAccount(context.Context, *CreateUserCommand) (*User, error)
|
2022-07-19 09:01:05 -05:00
|
|
|
Delete(context.Context, *DeleteUserCommand) error
|
2022-08-02 09:58:05 -05:00
|
|
|
GetByID(context.Context, *GetUserByIDQuery) (*User, error)
|
2024-07-26 09:09:08 -05:00
|
|
|
GetByUID(context.Context, *GetUserByUIDQuery) (*User, error)
|
2022-08-04 06:22:43 -05:00
|
|
|
GetByLogin(context.Context, *GetUserByLoginQuery) (*User, error)
|
2022-08-04 06:47:30 -05:00
|
|
|
GetByEmail(context.Context, *GetUserByEmailQuery) (*User, error)
|
2022-08-04 07:22:44 -05:00
|
|
|
Update(context.Context, *UpdateUserCommand) error
|
2022-08-04 08:44:14 -05:00
|
|
|
UpdateLastSeenAt(context.Context, *UpdateUserLastSeenAtCommand) error
|
2022-08-12 05:13:26 -05:00
|
|
|
GetSignedInUser(context.Context, *GetSignedInUserQuery) (*SignedInUser, error)
|
|
|
|
Search(context.Context, *SearchUsersQuery) (*SearchUserQueryResult, error)
|
|
|
|
BatchDisableUsers(context.Context, *BatchDisableUsersCommand) error
|
2022-10-04 07:14:32 -05:00
|
|
|
GetProfile(context.Context, *GetUserProfileQuery) (*UserProfileDTO, error)
|
2022-06-28 07:32:25 -05:00
|
|
|
}
|
2024-03-14 07:25:28 -05:00
|
|
|
|
|
|
|
type Verifier interface {
|
2024-03-28 10:05:33 -05:00
|
|
|
Start(ctx context.Context, cmd StartVerifyEmailCommand) error
|
|
|
|
Complete(ctx context.Context, cmd CompleteEmailVerifyCommand) error
|
2024-03-14 07:25:28 -05:00
|
|
|
}
|