stringsvc

package module
v0.0.0-...-3c5f979 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2016 License: MIT Imports: 10 Imported by: 0

README

stringsvc GoDoc

An implementation of go-kit's stringsvc example, using profilesvc package layout style.

Get started

All steps below requires docker and docker-compose installed, preferred on a Mac/Linux machine.

  • Test
make test
  • Build
make build
  • Run (this step also rebuild and run the output binary)
make run
  • Benchmark
make bench

Documentation

Index

Constants

This section is empty.

Variables

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

ErrEmpty is returned when input string is empty

Functions

func MakeCountEndpoint

func MakeCountEndpoint(svc Service) endpoint.Endpoint

func MakeHTTPHandler

func MakeHTTPHandler(ctx context.Context, s Service, logger log.Logger) http.Handler

MakeHTTPHandler mounts all of the service endpoints into an http.Handler.

func MakeUppercaseEndpoint

func MakeUppercaseEndpoint(svc Service) endpoint.Endpoint

Types

type Middleware

type Middleware func(Service) Service

Middleware describes a service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

type Service

type Service interface {
	Uppercase(context.Context, string) (string, error)
	Count(context.Context, string) int
}

Service provide operations on string.

func NewStringService

func NewStringService() Service

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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