account

package
v0.0.0-...-3eb4ebe Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeIsAuthEndpoint

func MakeIsAuthEndpoint(s Service) endpoint.Endpoint

MakeIsAuthEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func MakeLoginEndpoint

func MakeLoginEndpoint(s Service) endpoint.Endpoint

MakeLoginEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func MakeLogoutEndpoint

func MakeLogoutEndpoint(s Service) endpoint.Endpoint

MakeLogoutEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func MakeServiceStatusEndpoint

func MakeServiceStatusEndpoint(s Service) endpoint.Endpoint

MakeServiceStatusEndpoint will receive a request, convert to the desired format, invoke the service and return the response structure

func MakeSignUpEndpoint

func MakeSignUpEndpoint(s Service) endpoint.Endpoint

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

type IsAuthRequest struct {
	Token token.Token `json:"token"`
}

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

type LogoutRequest struct {
	Token token.Token `json:"token"`
}

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

type ServiceStatusResponse struct {
	Code int    `json:"code"`
	Err  string `json:"err,omitempty"`
}

ServiceStatusResponse -> ServiceStatus endpoint's output structure

type Set

type Set struct {
	IsAuthEndpoint        endpoint.Endpoint
	SignUpEndpoint        endpoint.Endpoint
	LoginEndpoint         endpoint.Endpoint
	LogoutEndpoint        endpoint.Endpoint
	ServiceStatusEndpoint endpoint.Endpoint
}

func New

func New(s Service) Set

type SignUpRequest

type SignUpRequest struct {
	User repository.User `json:"user"`
}

SignUpRequest -> SignUp endpoint's input structures

type SignUpResponse

type SignUpResponse struct {
	UserId uint64      `json:"userId,omitempty"`
	Token  token.Token `json:"token,omitempty"`
	Err    string      `json:"err,omitempty"`
}

SignUpResponse -> SignUp endpoint's output structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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