server

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 11 Imported by: 9

Documentation

Overview

Package server defines the server's interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(c *echo.Context, e *errors.ErrorResponse) error

ErrorResponse returns a JSON error response

Types

type Config

type Config struct {
	Name         string
	Addr         string
	Timeout      time.Duration
	HealthCheck  func() error
	ShutdownFunc func()
	Middleware   []echo.MiddlewareFunc
}

Config is the configuration for the server

type Server

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

Server is an instance of the server

func New

func New(config *Config) *Server

New returns a configured Server struct

func (*Server) Echo

func (s *Server) Echo() *echo.Echo

Echo returns the echo instance for this server

func (*Server) Start

func (s *Server) Start()

Start starts up the server and begins serving traffic

func (*Server) StartTest

func (s *Server) StartTest() string

StartTest starts up the test server and begins serving traffic

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully shuts down the server

func (*Server) StopTest

func (s *Server) StopTest()

StopTest shuts down the test server

Jump to

Keyboard shortcuts

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