service

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Auth authenticates and authorizes the user token for an object/action.

func (*UserCenterService) Authenticate

Authenticate validates the user token and returns the user ID.

func (*UserCenterService) Authorize

Authorize checks whether the user is authorized for the object/action.

func (*UserCenterService) CreateSecret

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

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

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

GetUser receives a GetUserRequest and returns a UserReply with the corresponding user information and an error if there's any.

func (*UserCenterService) ListSecret

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

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

Login authenticates the user credentials and returns a token on success.

func (*UserCenterService) Logout

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

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.

Jump to

Keyboard shortcuts

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