endpoints

package
v0.0.0-...-4c9bff6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(method string) endpoint.Middleware

LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any.

func MakeSigninEndpoint

func MakeSigninEndpoint(svc service.IdentityService) endpoint.Endpoint

MakeSigninEndpoint make signin endpoint

func MakeSignupEndpoint

func MakeSignupEndpoint(svc service.IdentityService) endpoint.Endpoint

MakeSignupEndpoint make signup endpoint

func ValidateMiddleware

func ValidateMiddleware(validate *validator.Validate, trans ut.Translator) endpoint.Middleware

ValidateMiddleware returns an endpoint middleware that validate each invocation, and the resulting error, if any.

Types

type Endpoints

type Endpoints struct {
	SigninEndpoint endpoint.Endpoint
	SignupEndpoint endpoint.Endpoint
}

Endpoints contain all identity endpoint

func New

func New(svc service.IdentityService) (ep Endpoints)

New endpoints

type SigninRequest

type SigninRequest struct {
	Username string `json:"username" validate:"required"`
	Password string `json:"password" validate:"required"`

	IPAddress   string        `json:"ip_address"`
	Platform    string        `json:"platform"`
	IdpProvider string        `json:"idp_provider"`
	Device      entity.Device `json:"device"`
}

SigninRequest define signin request

type SigninResponse

type SigninResponse struct {
	IDToken      string `json:"id_token"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

SigninResponse define signup response

type SignupRequest

type SignupRequest struct {
	Username  string        `json:"username,omitempty"`
	Password  string        `json:"password,omitempty"`
	Nickname  string        `json:"nickname,omitempty"`
	FirstName string        `json:"first_name,omitempty"`
	LastName  string        `json:"last_name,omitempty"`
	Email     string        `json:"email,omitempty"`
	Platform  string        `json:"platform,omitempty"`
	IPAddress string        `json:"ip_address,omitempty"`
	Device    entity.Device `json:"device"`
}

SignupRequest define signup response

type SignupResponse

type SignupResponse struct {
	IDToken      string `json:"id_token"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

SignupResponse define signup response

Jump to

Keyboard shortcuts

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