api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.

Index

Constants

View Source
const MailSent = "Email with reset link is sent"

MailSent message response when link is sent

Variables

View Source
var (

	// ErrUnsupportedContentType indicates unacceptable or lack of Content-Type
	ErrUnsupportedContentType = errors.New("unsupported content type")

	// ErrFailedDecode indicates failed to decode request body
	ErrFailedDecode = errors.New("failed to decode request body")
)

Functions

func LoggingMiddleware

func LoggingMiddleware(svc users.Service, logger log.Logger) users.Service

LoggingMiddleware adds logging facilities to the core service.

func MakeHandler

func MakeHandler(svc users.Service, tracer opentracing.Tracer, l log.Logger) http.Handler

MakeHandler returns a HTTP handler for API endpoints.

func MetricsMiddleware

func MetricsMiddleware(svc users.Service, counter metrics.Counter, latency metrics.Histogram) users.Service

MetricsMiddleware instruments core service by tracking request count and latency.

Types

This section is empty.

Directories

Path Synopsis
Package http contains implementation of users service HTTP API.
Package http contains implementation of users service HTTP API.

Jump to

Keyboard shortcuts

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