Documentation
¶
Overview ¶
Package meari provides a simple webserver feature to enable interactive actions such as MTR looking glass.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultServer ¶
type DefaultServer struct { *echo.Echo // contains filtered or unexported fields }
DefaultServer is a "echo" based simple webserver that implements the Server interface.
func NewDefaultServer ¶ added in v0.3.2
func NewDefaultServer(opts *Options) *DefaultServer
NewDefaultServer initializes an instance of defaultServer, registers the "root" handler, and returns it as a Server. Currently, Server works as a singleton.
func (*DefaultServer) Address ¶
func (s *DefaultServer) Address() string
Address implements the Server interface.
func (*DefaultServer) GET ¶
func (s *DefaultServer) GET(path string, handler echo.HandlerFunc)
GET implements the Server interface.
func (*DefaultServer) Serve ¶ added in v0.4.0
func (s *DefaultServer) Serve() error
Serve implements the Server interface.
type Options ¶
Options is a basic structure that contains all options for the Server implementation.
type Server ¶
type Server interface { // Address returns the address on which the server is listening. Address() string // Serve starts the webserver and wait until the server stops. // It has the same behavior of `(http.Server).Serve()` and always returns // non-nil error. Expected error is `http.ErrServerClosed`. Serve() error // Shutdown stops the webserver gracefully. // It is equivalent to `(http.Server).Shutdown()` Shutdown(context context.Context) error // GET registers a new GET route for the given path with the given request handler. GET(path string, handler echo.HandlerFunc) }
Server is an interface for the built-in webserver.
Click to show internal directories.
Click to hide internal directories.