Documentation ¶
Index ¶
- Variables
- func CheckPassword(password string, hashedPassword []byte) bool
- func CheckUserPassword(u *model.User, password string) bool
- func GenUserPassword(password string) ([]byte, error)
- func GenUserPasswordVersion(hashedPassword []byte) uint32
- func NewDBUtils(db *gorm.DB) *dbUtils
- func SetUserPassword(u *model.User, password string) error
- func SetUsername(u *model.User, name string) error
- type UserRcache
- func (uc *UserRcache) DelUserIDCache(ctx context.Context, name string) error
- func (uc *UserRcache) DelUserInfoCache(ctx context.Context, id string) error
- func (uc *UserRcache) DelUserPasswordVersionCache(ctx context.Context, id string) error
- func (uc *UserRcache) GetUserID(ctx context.Context, name string) (string, error)
- func (uc *UserRcache) GetUserIDFromCache(ctx context.Context, name string) (string, error)
- func (uc *UserRcache) GetUserInfo(ctx context.Context, id string, fields ...string) (*user.UserInfo, error)
- func (uc *UserRcache) GetUserInfoByUsername(ctx context.Context, name string, fields ...string) (*user.UserInfo, error)
- func (uc *UserRcache) GetUserInfoFromCache(ctx context.Context, id string, fields ...string) (*user.UserInfo, error)
- func (uc *UserRcache) GetUserLastSeen(ctx context.Context, id string) (*user.UserLastSeen, error)
- func (uc *UserRcache) GetUserPasswordVersion(ctx context.Context, id string) (uint32, error)
- func (uc *UserRcache) GetUserPasswordVersionFromCache(ctx context.Context, id string) (uint64, error)
- func (uc *UserRcache) SetUserIDToCache(ctx context.Context, name, id string) error
- func (uc *UserRcache) SetUserInfoToCache(ctx context.Context, id string, info *user.UserInfo) error
- func (uc *UserRcache) SetUserPassword(ctx context.Context, id string, password string) error
- func (uc *UserRcache) SetUserPasswordVersionToCache(ctx context.Context, id string, version uint32) error
- func (uc *UserRcache) SetUserRole(ctx context.Context, id string, role user.Role) error
- func (uc *UserRcache) SetUserStatus(ctx context.Context, id string, status user.Status) error
- func (uc *UserRcache) SetUsername(ctx context.Context, id, name string) (string, error)
- func (uc *UserRcache) UpdateUserLastSeen(ctx context.Context, id string, lastSeen *user.UserLastSeen) error
- type UserService
- func (us *UserService) BindEmail(ctx context.Context, req *user.BindEmailReq) (*user.Empty, error)
- func (us *UserService) CreateUser(ctx context.Context, req *user.CreateUserReq) (*user.UserInfo, error)
- func (us *UserService) FollowAllDevice(ctx context.Context, req *user.FollowAllDeviceReq) (*user.Empty, error)
- func (us *UserService) FollowDevice(ctx context.Context, req *user.FollowDeviceReq) (*user.Empty, error)
- func (us *UserService) GetUserId(ctx context.Context, req *user.GetUserIdReq) (*user.GetUserIdResp, error)
- func (us *UserService) GetUserInfo(ctx context.Context, req *user.GetUserInfoReq) (*user.UserInfo, error)
- func (us *UserService) GetUserInfoByUsername(ctx context.Context, req *user.GetUserInfoByUsernameReq) (*user.UserInfo, error)
- func (us *UserService) GetUserLastSeen(ctx context.Context, req *user.GetUserLastSeenReq) (*user.UserLastSeen, error)
- func (us *UserService) GetUserPasswordVersion(ctx context.Context, req *user.GetUserPasswordVersionReq) (*user.GetUserPasswordVersionResp, error)
- func (us *UserService) HasFollowedDevice(ctx context.Context, req *user.HasFollowedDeviceReq) (*user.HasFollowedDeviceResp, error)
- func (us *UserService) ListFollowedDeviceIDs(ctx context.Context, req *user.ListFollowedDeviceIDsReq) (*user.ListFollowedDeviceIDsResp, error)
- func (us *UserService) ListFollowedUserIDsByDevice(ctx context.Context, req *user.ListFollowedUserIDsByDeviceReq) (*user.ListFollowedUserIDsByDeviceResp, error)
- func (us *UserService) ListFollowedUserNotificationMethodsByDevice(ctx context.Context, req *user.ListFollowedUserNotificationMethodsByDeviceReq) (*user.ListFollowedUserNotificationMethodsByDeviceResp, error)
- func (us *UserService) ListUser(ctx context.Context, req *user.ListUserReq) (*user.ListUserResp, error)
- func (us *UserService) SetUserPassword(ctx context.Context, req *user.SetUserPasswordReq) (*user.Empty, error)
- func (us *UserService) SetUserRole(ctx context.Context, req *user.SetUserRoleReq) (*user.Empty, error)
- func (us *UserService) SetUserStatus(ctx context.Context, req *user.SetUserStatusReq) (*user.Empty, error)
- func (us *UserService) SetUsername(ctx context.Context, req *user.SetUsernameReq) (*user.SetUsernameResp, error)
- func (us *UserService) UnbindEmail(ctx context.Context, req *user.UnbindEmailReq) (*user.Empty, error)
- func (us *UserService) UnfollowAllDevice(ctx context.Context, req *user.UnfollowAllDeviceReq) (*user.Empty, error)
- func (us *UserService) UnfollowDevice(ctx context.Context, req *user.UnfollowDeviceReq) (*user.Empty, error)
- func (us *UserService) UpdateUserLastSeen(ctx context.Context, req *user.UpdateUserLastSeenReq) (*user.Empty, error)
- func (us *UserService) ValidateUserPassword(ctx context.Context, req *user.ValidateUserPasswordReq) (*user.ValidateUserPasswordResp, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPasswordTooShort = errors.New("password too short") ErrPasswordTooLong = errors.New("password too long") ErrPasswordHasInvalidChar = errors.New("password has invalid char") ErrUsernameTooShort = errors.New("username too short") ErrUsernameTooLong = errors.New("username too long") ErrUsernameHasInvalidChar = errors.New("username has invalid char") )
View Source
var ProviderSet = wire.NewSet(NewUserService)
ProviderSet is service providers.
Functions ¶
func CheckPassword ¶
func GenUserPassword ¶
func GenUserPasswordVersion ¶
func NewDBUtils ¶
Types ¶
type UserRcache ¶
type UserRcache struct {
// contains filtered or unexported fields
}
func NewUserRcache ¶
func NewUserRcache(rcache *rcache.Rcache, client *dbUtils) *UserRcache
func (*UserRcache) DelUserIDCache ¶
func (uc *UserRcache) DelUserIDCache(ctx context.Context, name string) error
func (*UserRcache) DelUserInfoCache ¶
func (uc *UserRcache) DelUserInfoCache(ctx context.Context, id string) error
func (*UserRcache) DelUserPasswordVersionCache ¶
func (uc *UserRcache) DelUserPasswordVersionCache(ctx context.Context, id string) error
func (*UserRcache) GetUserIDFromCache ¶
func (*UserRcache) GetUserInfo ¶
func (*UserRcache) GetUserInfoByUsername ¶ added in v0.2.2
func (*UserRcache) GetUserInfoFromCache ¶
func (*UserRcache) GetUserLastSeen ¶ added in v0.3.0
func (uc *UserRcache) GetUserLastSeen(ctx context.Context, id string) (*user.UserLastSeen, error)
func (*UserRcache) GetUserPasswordVersion ¶
func (*UserRcache) GetUserPasswordVersionFromCache ¶
func (*UserRcache) SetUserIDToCache ¶
func (uc *UserRcache) SetUserIDToCache(ctx context.Context, name, id string) error
func (*UserRcache) SetUserInfoToCache ¶
func (*UserRcache) SetUserPassword ¶
func (*UserRcache) SetUserPasswordVersionToCache ¶
func (*UserRcache) SetUserRole ¶
func (*UserRcache) SetUserStatus ¶
func (*UserRcache) SetUsername ¶ added in v0.2.2
func (*UserRcache) UpdateUserLastSeen ¶ added in v0.3.0
func (uc *UserRcache) UpdateUserLastSeen(ctx context.Context, id string, lastSeen *user.UserLastSeen) error
type UserService ¶
type UserService struct { user.UnimplementedUserServer // contains filtered or unexported fields }
func NewUserService ¶
func NewUserService(dc *conf.DatabaseServerConfig, uc *conf.UserConfig, rc *conf.RedisConfig) *UserService
func (*UserService) BindEmail ¶ added in v0.3.0
func (us *UserService) BindEmail(ctx context.Context, req *user.BindEmailReq) (*user.Empty, error)
func (*UserService) CreateUser ¶
func (us *UserService) CreateUser(ctx context.Context, req *user.CreateUserReq) (*user.UserInfo, error)
func (*UserService) FollowAllDevice ¶ added in v0.3.0
func (us *UserService) FollowAllDevice(ctx context.Context, req *user.FollowAllDeviceReq) (*user.Empty, error)
func (*UserService) FollowDevice ¶ added in v0.3.0
func (us *UserService) FollowDevice(ctx context.Context, req *user.FollowDeviceReq) (*user.Empty, error)
func (*UserService) GetUserId ¶
func (us *UserService) GetUserId(ctx context.Context, req *user.GetUserIdReq) (*user.GetUserIdResp, error)
func (*UserService) GetUserInfo ¶
func (us *UserService) GetUserInfo(ctx context.Context, req *user.GetUserInfoReq) (*user.UserInfo, error)
func (*UserService) GetUserInfoByUsername ¶ added in v0.2.2
func (us *UserService) GetUserInfoByUsername(ctx context.Context, req *user.GetUserInfoByUsernameReq) (*user.UserInfo, error)
func (*UserService) GetUserLastSeen ¶ added in v0.3.0
func (us *UserService) GetUserLastSeen(ctx context.Context, req *user.GetUserLastSeenReq) (*user.UserLastSeen, error)
func (*UserService) GetUserPasswordVersion ¶
func (us *UserService) GetUserPasswordVersion(ctx context.Context, req *user.GetUserPasswordVersionReq) (*user.GetUserPasswordVersionResp, error)
func (*UserService) HasFollowedDevice ¶ added in v0.3.0
func (us *UserService) HasFollowedDevice(ctx context.Context, req *user.HasFollowedDeviceReq) (*user.HasFollowedDeviceResp, error)
func (*UserService) ListFollowedDeviceIDs ¶ added in v0.3.0
func (us *UserService) ListFollowedDeviceIDs(ctx context.Context, req *user.ListFollowedDeviceIDsReq) (*user.ListFollowedDeviceIDsResp, error)
func (*UserService) ListFollowedUserIDsByDevice ¶ added in v0.3.0
func (us *UserService) ListFollowedUserIDsByDevice(ctx context.Context, req *user.ListFollowedUserIDsByDeviceReq) (*user.ListFollowedUserIDsByDeviceResp, error)
func (*UserService) ListFollowedUserNotificationMethodsByDevice ¶ added in v0.3.3
func (us *UserService) ListFollowedUserNotificationMethodsByDevice(ctx context.Context, req *user.ListFollowedUserNotificationMethodsByDeviceReq) (*user.ListFollowedUserNotificationMethodsByDeviceResp, error)
func (*UserService) ListUser ¶
func (us *UserService) ListUser(ctx context.Context, req *user.ListUserReq) (*user.ListUserResp, error)
func (*UserService) SetUserPassword ¶
func (us *UserService) SetUserPassword(ctx context.Context, req *user.SetUserPasswordReq) (*user.Empty, error)
func (*UserService) SetUserRole ¶
func (us *UserService) SetUserRole(ctx context.Context, req *user.SetUserRoleReq) (*user.Empty, error)
func (*UserService) SetUserStatus ¶
func (us *UserService) SetUserStatus(ctx context.Context, req *user.SetUserStatusReq) (*user.Empty, error)
func (*UserService) SetUsername ¶ added in v0.2.2
func (us *UserService) SetUsername(ctx context.Context, req *user.SetUsernameReq) (*user.SetUsernameResp, error)
func (*UserService) UnbindEmail ¶ added in v0.3.0
func (us *UserService) UnbindEmail(ctx context.Context, req *user.UnbindEmailReq) (*user.Empty, error)
func (*UserService) UnfollowAllDevice ¶ added in v0.3.0
func (us *UserService) UnfollowAllDevice(ctx context.Context, req *user.UnfollowAllDeviceReq) (*user.Empty, error)
func (*UserService) UnfollowDevice ¶ added in v0.3.0
func (us *UserService) UnfollowDevice(ctx context.Context, req *user.UnfollowDeviceReq) (*user.Empty, error)
func (*UserService) UpdateUserLastSeen ¶ added in v0.3.0
func (us *UserService) UpdateUserLastSeen(ctx context.Context, req *user.UpdateUserLastSeenReq) (*user.Empty, error)
func (*UserService) ValidateUserPassword ¶
func (us *UserService) ValidateUserPassword(ctx context.Context, req *user.ValidateUserPasswordReq) (*user.ValidateUserPasswordResp, error)
Click to show internal directories.
Click to hide internal directories.