Documentation
¶
Index ¶
- type AccessToken
- type Paging
- type RefreshToken
- type TipherethRepo
- type TipherethUseCase
- func (t *TipherethUseCase) AddUser(ctx context.Context, user *User) (*User, *errors.Error)
- func (t *TipherethUseCase) GetToken(ctx context.Context, user *User) (AccessToken, RefreshToken, *errors.Error)
- func (t *TipherethUseCase) ListUser(ctx context.Context, paging Paging, types []libauth.UserType, ...) ([]*User, *errors.Error)
- func (t *TipherethUseCase) RefreshToken(ctx context.Context) (AccessToken, RefreshToken, *errors.Error)
- func (t *TipherethUseCase) UpdateUser(ctx context.Context, user *User) *errors.Error
- type User
- type UserStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken string
type RefreshToken ¶
type RefreshToken string
type TipherethRepo ¶
type TipherethRepo interface { UserActive(context.Context, *User) (bool, error) FetchUserByPassword(context.Context, *User) (*User, error) AddUser(context.Context, *User) error UpdateUser(context.Context, *User) error ListUser(context.Context, Paging, []libauth.UserType, []UserStatus) ([]*User, error) }
TipherethRepo is a User repo.
type TipherethUseCase ¶
type TipherethUseCase struct {
// contains filtered or unexported fields
}
TipherethUseCase is a User use case.
func NewTipherethUseCase ¶
func NewTipherethUseCase(repo TipherethRepo, auth *libauth.Auth, sClient searcher.LibrarianSearcherServiceClient) *TipherethUseCase
NewTipherethUseCase new a User use case.
func (*TipherethUseCase) GetToken ¶
func (t *TipherethUseCase) GetToken(ctx context.Context, user *User) (AccessToken, RefreshToken, *errors.Error)
func (*TipherethUseCase) ListUser ¶
func (t *TipherethUseCase) ListUser(ctx context.Context, paging Paging, types []libauth.UserType, statuses []UserStatus) ([]*User, *errors.Error)
func (*TipherethUseCase) RefreshToken ¶
func (t *TipherethUseCase) RefreshToken(ctx context.Context) (AccessToken, RefreshToken, *errors.Error)
func (*TipherethUseCase) UpdateUser ¶
type User ¶
type User struct { InternalID int64 UserName string PassWord string Type libauth.UserType Status UserStatus }
User is a User model.
type UserStatus ¶
type UserStatus int
const ( UserStatusUnspecified UserStatus = iota UserStatusActive UserStatusBlocked )
Click to show internal directories.
Click to hide internal directories.