Sha256: 0d6f3c74185851d8484664a0306941cce4a1d2a579ccf2bbf375de5193441028

Contents?: true

Size: 538 Bytes

Versions: 3

Compression:

Stored size: 538 Bytes

Contents

package handlers

import (
	"reflect"

	log "github.com/Sirupsen/logrus"
	"github.com/gorilla/pat"
)

func GetRouter(logger *log.Logger) *pat.Router {
	r := pat.New()

	echoHandler := newEchoHandler(echoHandlerDependencies{logger})
	healthHandler := newHealthHandler(healthHandlerDependencies{logger})
	validationHandler := newRequestValidationHandler(
		requestValidationDependencies{logger},
		reflect.TypeOf(Echo{}),
		echoHandler)

	r.Add("GET", "/v1/health", healthHandler)
	r.Add("POST", "/v1/echo", validationHandler)

	return r
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minke-generator-go-0.9.3 lib/generators/gomicroservice/scaffold/handlers/xx_router.go.erb
minke-generator-go-0.9.2 lib/generators/gomicroservice/scaffold/handlers/xx_router.go.erb
minke-generator-go-0.9.1 lib/generators/gomicroservice/scaffold/handlers/xx_router.go.erb