Documentation ¶
Overview ¶
THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!!
Index ¶
- func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware
- func LoggingMiddleware(logger log.Logger) endpoint.Middleware
- func MakeLoginPEndpoint(s service.AuthService) endpoint.Endpoint
- func MakeLoginUPEndpoint(s service.AuthService) endpoint.Endpoint
- func MakeRegisterEndpoint(s service.AuthService) endpoint.Endpoint
- func MakeVerifyEndpoint(s service.AuthService) endpoint.Endpoint
- type Endpoints
- func (e Endpoints) LoginP(ctx context.Context, Phone string) (Response model.User, err error)
- func (e Endpoints) LoginUP(ctx context.Context, Username string, Password string) (Response model.User, err error)
- func (e Endpoints) Register(ctx context.Context, Username string, Password string, Name string, ...) (Response model.User, err error)
- func (e Endpoints) Verify(ctx context.Context, Token string, Type string, Code string) (Response model.User, err error)
- type Failure
- type LoginPRequest
- type LoginPResponse
- type LoginUPRequest
- type LoginUPResponse
- type RegisterRequest
- type RegisterResponse
- type VerifyRequest
- type VerifyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentingMiddleware ¶
func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware
InstrumentingMiddleware returns an endpoint middleware that records the duration of each invocation to the passed histogram. The middleware adds a single field: "success", which is "true" if no error is returned, and "false" otherwise.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) endpoint.Middleware
LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any.
func MakeLoginPEndpoint ¶
func MakeLoginPEndpoint(s service.AuthService) endpoint.Endpoint
MakeLoginPEndpoint returns an endpoint that invokes LoginP on the service.
func MakeLoginUPEndpoint ¶
func MakeLoginUPEndpoint(s service.AuthService) endpoint.Endpoint
MakeLoginUPEndpoint returns an endpoint that invokes LoginUP on the service.
func MakeRegisterEndpoint ¶
func MakeRegisterEndpoint(s service.AuthService) endpoint.Endpoint
MakeRegisterEndpoint returns an endpoint that invokes Register on the service.
func MakeVerifyEndpoint ¶
func MakeVerifyEndpoint(s service.AuthService) endpoint.Endpoint
MakeVerifyEndpoint returns an endpoint that invokes Verify on the service.
Types ¶
type Endpoints ¶
type Endpoints struct { RegisterEndpoint endpoint.Endpoint LoginUPEndpoint endpoint.Endpoint LoginPEndpoint endpoint.Endpoint VerifyEndpoint endpoint.Endpoint }
Endpoints collects all of the endpoints that compose a profile service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
func New ¶
func New(s service.AuthService, mdw map[string][]endpoint.Middleware) Endpoints
New returns a Endpoints struct that wraps the provided service, and wires in all of the expected endpoint middlewares
func (Endpoints) LoginUP ¶
func (e Endpoints) LoginUP(ctx context.Context, Username string, Password string) (Response model.User, err error)
LoginUP implements Service. Primarily useful in a client.
type Failure ¶
type Failure interface {
Failed() error
}
Failure is an interface that should be implemented by response types. Response encoders can check if responses are Failer, and if so they've failed, and if so encode them using a separate write path based on the error.
type LoginPRequest ¶
type LoginPRequest struct {
Phone string `json:"phone"`
}
LoginPRequest collects the request parameters for the LoginP method.
type LoginPResponse ¶
LoginPResponse collects the response parameters for the LoginP method.
type LoginUPRequest ¶
LoginUPRequest collects the request parameters for the LoginUP method.
type LoginUPResponse ¶
LoginUPResponse collects the response parameters for the LoginUP method.
type RegisterRequest ¶
type RegisterRequest struct { Username string `json:"username"` Password string `json:"password"` Name string `json:"name"` LastName string `json:"last_name"` Phone string `json:"phone"` Email string `json:"email"` }
RegisterRequest collects the request parameters for the Register method.
type RegisterResponse ¶
RegisterResponse collects the response parameters for the Register method.
type VerifyRequest ¶
type VerifyRequest struct { Token string `json:"token"` Type string `json:"type"` Code string `json:"code"` }
VerifyRequest collects the request parameters for the Verify method.
type VerifyResponse ¶
VerifyResponse collects the response parameters for the Verify method.