service

package
v0.0.0-...-3c3176f Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("empty string")

ErrEmpty is returned when an input string is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware func(StringService) StringService

Middleware describes a service (as opposed to endpoint) middleware.

func InstrumentingMiddleware

func InstrumentingMiddleware() Middleware

InstrumentingMiddleware returns a service middleware that count the number of jobs processed, record the duration of requests after they’ve finished and track the number of in-flight operations.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a ServiceMiddleware.

type StringService

type StringService interface {
	Uppercase(string) (string, error)
	Count(string) int
}

StringService provides operations on strings.

func New

func New(logger log.Logger) StringService

New returns a basic Service with all of the expected middlewares wired in.

func NewStringService

func NewStringService() StringService

NewStringService returns a naïve, stateless implementation of StringService.

Jump to

Keyboard shortcuts

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