service

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(key, value interface{}) (err error)
	Get(key interface{}) (value interface{}, err error)
}

Cache interface uses for middleware as key-value storage for requests.

type Middleware

type Middleware func(service.UserService) service.UserService

Service middleware (closure).

func CachingMiddleware

func CachingMiddleware(cache Cache) Middleware

func ErrorLoggingMiddleware

func ErrorLoggingMiddleware(logger log.Logger) Middleware

ErrorLoggingMiddleware writes to logger any error, if it is not nil.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware writes params, results and working time of method call to provided logger after its execution.

func RecoveringMiddleware

func RecoveringMiddleware(logger log.Logger) Middleware

RecoveringMiddleware recovers panics from method calls, writes to provided logger and returns the error of panic as method error.

Jump to

Keyboard shortcuts

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