Documentation ¶
Index ¶
- func MakeIsAuthEndpoint(s Service) endpoint.Endpoint
- func MakeLoginEndpoint(s Service) endpoint.Endpoint
- func MakeLogoutEndpoint(s Service) endpoint.Endpoint
- func MakeServiceStatusEndpoint(s Service) endpoint.Endpoint
- func MakeSignUpEndpoint(s Service) endpoint.Endpoint
- func NewGRPCServer(ep Set) pb.AccountServer
- type IsAuthRequest
- type IsAuthResponse
- type LoginRequest
- type LoginResponse
- type LogoutRequest
- type LogoutResponse
- type Service
- type ServiceStatusRequest
- type ServiceStatusResponse
- type Set
- type SignUpRequest
- type SignUpResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeIsAuthEndpoint ¶
MakeIsAuthEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func MakeLoginEndpoint ¶
MakeLoginEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func MakeLogoutEndpoint ¶
MakeLogoutEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func MakeServiceStatusEndpoint ¶
MakeServiceStatusEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func MakeSignUpEndpoint ¶
MakeSignUpEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure
func NewGRPCServer ¶
func NewGRPCServer(ep Set) pb.AccountServer
Types ¶
type IsAuthRequest ¶
IsAuthRequest -> IsAuth endpoint's input structures
type IsAuthResponse ¶
type IsAuthResponse struct { Token token.Token `json:"token,omitempty"` Err string `json:"err,omitempty"` }
IsAuthResponse -> IsAuth endpoint's output structure
type LoginRequest ¶
type LoginRequest struct {
User repository.User `json:"user"`
}
LoginRequest -> Login endpoint's input structures
type LoginResponse ¶
type LoginResponse struct { UserId uint64 `json:"userId,omitempty"` Token token.Token `json:"token,omitempty"` Err string `json:"err,omitempty"` }
LoginResponse -> Login endpoint's output structure
type LogoutRequest ¶
LogoutRequest -> Logout endpoint's input structures
type LogoutResponse ¶
type LogoutResponse struct {
Err string `json:"err,omitempty"`
}
LogoutResponse -> Logout endpoint's output structure
type Service ¶
type Service interface { IsAuth(ctx context.Context, token token.Token) (token.Token, error) SignUp(ctx context.Context, user repository.User) (uint64, token.Token, error) Login(ctx context.Context, user repository.User) (uint64, token.Token, error) Logout(ctx context.Context, token token.Token) error ServiceStatus(ctx context.Context) (int, error) }
func NewService ¶
func NewService(accountRepository repository.AccountRepository, customRedisStore store.SerializableStore) Service
type ServiceStatusRequest ¶
type ServiceStatusRequest struct{}
ServiceStatusRequest -> ServiceStatus endpoint's input structures
type ServiceStatusResponse ¶
ServiceStatusResponse -> ServiceStatus endpoint's output structure
type Set ¶
type SignUpRequest ¶
type SignUpRequest struct {
User repository.User `json:"user"`
}
SignUpRequest -> SignUp endpoint's input structures