endpoint

package
v0.0.0-...-bfcc399 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstrumentingMiddleware

func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) endpoint.Middleware

func MakeGetUserEndpoint

func MakeGetUserEndpoint(s service.Service) endpoint.Endpoint

func MakeLoginEndpoint

func MakeLoginEndpoint(s service.Service) endpoint.Endpoint

MakeLoginEndpoint constructs a Login endpoint wrapping the service.

func MakeRegisterEndpoint

func MakeRegisterEndpoint(s service.Service) endpoint.Endpoint

MakeRegisterEndpoint constructs a Register endpoint wrapping the service.

Types

type Set

type Set struct {
	GetUserEndpoint  endpoint.Endpoint
	RegisterEndpoint endpoint.Endpoint
	LoginEndpoint    endpoint.Endpoint
}

func New

func New(svc service.Service, logger log.Logger, duration metrics.Histogram,
	trace stdopentracing.Tracer) Set

func (Set) GetUser

func (s Set) GetUser(ctx context.Context, a string) (model.GetUserResponse, error)

GetUser implements the service interface, so Set may be used as a service.

func (Set) Login

func (s Set) Login(ctx context.Context, login model.LoginRequest) (model.LoginResponse, error)

Login implements the service interface.

func (Set) Register

func (s Set) Register(ctx context.Context, us model.RegisterRequest) (r model.RegisterUserResponse, err error)

Register implements the service interface,

Jump to

Keyboard shortcuts

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