Documentation ¶
Index ¶
- Variables
- type UserCenterService
- func (s *UserCenterService) Auth(ctx context.Context, rq *v1.AuthRequest) (*v1.AuthResponse, error)
- func (s *UserCenterService) Authenticate(ctx context.Context, rq *v1.AuthenticateRequest) (*v1.AuthenticateResponse, error)
- func (s *UserCenterService) Authorize(ctx context.Context, rq *v1.AuthorizeRequest) (*v1.AuthorizeResponse, error)
- func (s *UserCenterService) CreateSecret(ctx context.Context, rq *v1.CreateSecretRequest) (*v1.SecretReply, error)
- func (s *UserCenterService) CreateUser(ctx context.Context, rq *v1.CreateUserRequest) (*v1.UserReply, error)
- func (s *UserCenterService) DeleteSecret(ctx context.Context, rq *v1.DeleteSecretRequest) (*emptypb.Empty, error)
- func (s *UserCenterService) DeleteUser(ctx context.Context, rq *v1.DeleteUserRequest) (*emptypb.Empty, error)
- func (s *UserCenterService) GetSecret(ctx context.Context, rq *v1.GetSecretRequest) (*v1.SecretReply, error)
- func (s *UserCenterService) GetUser(ctx context.Context, rq *v1.GetUserRequest) (*v1.UserReply, error)
- func (s *UserCenterService) ListSecret(ctx context.Context, rq *v1.ListSecretRequest) (*v1.ListSecretResponse, error)
- func (s *UserCenterService) ListUser(ctx context.Context, rq *v1.ListUserRequest) (*v1.ListUserResponse, error)
- func (s *UserCenterService) Login(ctx context.Context, rq *v1.LoginRequest) (*v1.LoginReply, error)
- func (s *UserCenterService) Logout(ctx context.Context, rq *v1.LogoutRequest) (*emptypb.Empty, error)
- func (s *UserCenterService) RefreshToken(ctx context.Context, rq *v1.RefreshTokenRequest) (*v1.LoginReply, error)
- func (s *UserCenterService) UpdatePassword(ctx context.Context, rq *v1.UpdatePasswordRequest) (*emptypb.Empty, error)
- func (s *UserCenterService) UpdateSecret(ctx context.Context, rq *v1.UpdateSecretRequest) (*emptypb.Empty, error)
- func (s *UserCenterService) UpdateUser(ctx context.Context, rq *v1.UpdateUserRequest) (*emptypb.Empty, error)
Constants ¶
This section is empty.
Variables ¶
var ProviderSet = wire.NewSet(NewUserCenterService)
ProviderSet is a set of service providers, used for dependency injection.
Functions ¶
This section is empty.
Types ¶
type UserCenterService ¶
type UserCenterService struct { v1.UnimplementedUserCenterServer // Embeds the generated UnimplementedUserCenterServer struct. // contains filtered or unexported fields }
UserCenterService is a struct that implements the v1.UnimplementedUserCenterServer interface and holds the business logic, represented by a IBiz instance.
func NewUserCenterService ¶
func NewUserCenterService(biz biz.IBiz) *UserCenterService
NewUserCenterService is a constructor function that takes a IBiz instance as an input and returns a new UserCenterService instance.
func (*UserCenterService) Auth ¶
func (s *UserCenterService) Auth(ctx context.Context, rq *v1.AuthRequest) (*v1.AuthResponse, error)
Auth authenticates and authorizes the user token for an object/action.
func (*UserCenterService) Authenticate ¶
func (s *UserCenterService) Authenticate(ctx context.Context, rq *v1.AuthenticateRequest) (*v1.AuthenticateResponse, error)
Authenticate validates the user token and returns the user ID.
func (*UserCenterService) Authorize ¶
func (s *UserCenterService) Authorize(ctx context.Context, rq *v1.AuthorizeRequest) (*v1.AuthorizeResponse, error)
Authorize checks whether the user is authorized for the object/action.
func (*UserCenterService) CreateSecret ¶
func (s *UserCenterService) CreateSecret(ctx context.Context, rq *v1.CreateSecretRequest) (*v1.SecretReply, error)
CreateSecret is a method for creating a new secret. It takes a CreateSecretRequest as input and returns an Empty message or an error.
func (*UserCenterService) CreateUser ¶
func (s *UserCenterService) CreateUser(ctx context.Context, rq *v1.CreateUserRequest) (*v1.UserReply, error)
CreateUser receives a CreateUserRequest and creates a new user record in the datastore.
func (*UserCenterService) DeleteSecret ¶
func (s *UserCenterService) DeleteSecret(ctx context.Context, rq *v1.DeleteSecretRequest) (*emptypb.Empty, error)
DeleteSecret is a method for deleting a secret. It takes a DeleteSecretRequest as input and returns an Empty message or an error.
func (*UserCenterService) DeleteUser ¶
func (s *UserCenterService) DeleteUser(ctx context.Context, rq *v1.DeleteUserRequest) (*emptypb.Empty, error)
DeleteUser receives a DeleteUserRequest and removes the user record from the datastore. It returns an empty response (emptypb.Empty) and an error if there's any.
func (*UserCenterService) GetSecret ¶
func (s *UserCenterService) GetSecret(ctx context.Context, rq *v1.GetSecretRequest) (*v1.SecretReply, error)
GetSecret is a method for retrieving a specific secret. It takes a GetSecretRequest as input and returns a SecretReply with the secret or an error.
func (*UserCenterService) GetUser ¶
func (s *UserCenterService) GetUser(ctx context.Context, rq *v1.GetUserRequest) (*v1.UserReply, error)
GetUser receives a GetUserRequest and returns a UserReply with the corresponding user information and an error if there's any.
func (*UserCenterService) ListSecret ¶
func (s *UserCenterService) ListSecret(ctx context.Context, rq *v1.ListSecretRequest) (*v1.ListSecretResponse, error)
ListSecret is a method for listing secrets. It takes a ListSecretRequest as input and returns a ListSecretResponse with the secrets or an error.
func (*UserCenterService) ListUser ¶
func (s *UserCenterService) ListUser(ctx context.Context, rq *v1.ListUserRequest) (*v1.ListUserResponse, error)
ListUser receives a ListUserRequest and returns a ListUserResponse containing a list of users with pagination and an error if there is any.
func (*UserCenterService) Login ¶
func (s *UserCenterService) Login(ctx context.Context, rq *v1.LoginRequest) (*v1.LoginReply, error)
Login authenticates the user credentials and returns a token on success.
func (*UserCenterService) Logout ¶
func (s *UserCenterService) Logout(ctx context.Context, rq *v1.LogoutRequest) (*emptypb.Empty, error)
Logout invalidates the user token.
func (*UserCenterService) RefreshToken ¶
func (s *UserCenterService) RefreshToken(ctx context.Context, rq *v1.RefreshTokenRequest) (*v1.LoginReply, error)
RefreshToken generates a new token using the refresh token.
func (*UserCenterService) UpdatePassword ¶
func (s *UserCenterService) UpdatePassword(ctx context.Context, rq *v1.UpdatePasswordRequest) (*emptypb.Empty, error)
UpdatePassword receives an UpdatePasswordRequest and updates the user's password in the datastore. It returns an empty response (emptypb.Empty) and an error if there's any.
func (*UserCenterService) UpdateSecret ¶
func (s *UserCenterService) UpdateSecret(ctx context.Context, rq *v1.UpdateSecretRequest) (*emptypb.Empty, error)
UpdateSecret is a method for updating a secret. It takes an UpdateSecretRequest as input and returns an Empty message or an error.
func (*UserCenterService) UpdateUser ¶
func (s *UserCenterService) UpdateUser(ctx context.Context, rq *v1.UpdateUserRequest) (*emptypb.Empty, error)
UpdateUser receives an UpdateUserRequest and updates the user record in the datastore. It returns an empty response (emptypb.Empty) and an error if there's any.