Back to godoc.org

Package rest

v0.0.0-...-347c1b2
Latest Go to latest

The highest tagged major version is .

Published: Sep 10, 2020 | License: MIT | Module: github.com/acim/go-rest-server

Index

func DefaultRouter

func DefaultRouter(serviceName string, allowedOrigins []string, logger *zap.Logger) *chi.Mux

DefaultRouter creates chi mux with default middlewares. Supply nil for allowedOrigins to turn off CORS middleware. Example string for allowedOrigins: "https://example.com".

func NewLogger

func NewLogger(env string) (*zap.Logger, error)

NewLogger creates new zap logger.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server runs REST and metrics servers.

func NewServer

func NewServer(serviceName string, serverPort, metricsPort int, router *chi.Mux, logger *zap.Logger) *Server

NewServer creates new server.

func (*Server) Run

func (s *Server) Run()

Run starts REST and metrics servers.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier