server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Handler() func(echo.Context) error
}

Handler is a interface for represents request handlers

type Server

type Server struct {
	// Port is the port number of the server
	Port string

	// Handlers is the map of path to handler
	Handlers map[string]Handler

	// Echo is the echo instance
	Echo *echo.Echo
}

Server is the struct represents the server

func New

func New(port string, handlers map[string]Handler) *Server

New returns a new server

func (*Server) Start

func (s *Server) Start() error

Start starts the server

func (*Server) Stop

func (s *Server) Stop(timeout time.Duration) error

Stop stops the server

Jump to

Keyboard shortcuts

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