Documentation ¶
Index ¶
- Constants
- func ConfigAdd(path string)
- func ErrorHandlerJSON(err error, c e.Context)
- func ErrorHandlerString(err error, c e.Context)
- func ErrorStatusCode(err error) int
- type Options
- type Plugin
- type Server
- func (s *Server) Add(method string, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) Any(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) []*echo.Route
- func (s *Server) CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) File(path, file string, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) Group(prefix string, m ...echo.MiddlewareFunc) *echo.Group
- func (s *Server) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) Instance() *echo.Echo
- func (s *Server) Match(methods []string, path string, handler echo.HandlerFunc, ...) []*echo.Route
- func (s *Server) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) Options() *Options
- func (s *Server) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) Pre(middleware ...echo.MiddlewareFunc)
- func (s *Server) Serve(ctx context.Context)
- func (s *Server) Shutdown(ctx context.Context)
- func (s *Server) Static(prefix, root string) *echo.Route
- func (s *Server) Use(middleware ...echo.MiddlewareFunc)
- type WrappedLogger
- func (wl WrappedLogger) Debug(i ...interface{})
- func (wl WrappedLogger) Debugf(s string, i ...interface{})
- func (wl WrappedLogger) Debugj(j l.JSON)
- func (wl WrappedLogger) Error(i ...interface{})
- func (wl WrappedLogger) Errorf(s string, i ...interface{})
- func (wl WrappedLogger) Errorj(j l.JSON)
- func (wl WrappedLogger) Fatal(i ...interface{})
- func (wl WrappedLogger) Fatalf(s string, i ...interface{})
- func (wl WrappedLogger) Fatalj(j l.JSON)
- func (wl WrappedLogger) Info(i ...interface{})
- func (wl WrappedLogger) Infof(s string, i ...interface{})
- func (wl WrappedLogger) Infoj(j l.JSON)
- func (wl WrappedLogger) Level() l.Lvl
- func (wl WrappedLogger) Output() io.Writer
- func (wl WrappedLogger) Panic(i ...interface{})
- func (wl WrappedLogger) Panicf(format string, args ...interface{})
- func (wl WrappedLogger) Panicj(j l.JSON)
- func (wl WrappedLogger) Prefix() string
- func (wl WrappedLogger) Print(i ...interface{})
- func (wl WrappedLogger) Printf(s string, i ...interface{})
- func (wl WrappedLogger) Printj(j l.JSON)
- func (wl WrappedLogger) SetHeader(h string)
- func (wl WrappedLogger) SetLevel(v l.Lvl)
- func (wl WrappedLogger) SetOutput(w io.Writer)
- func (wl WrappedLogger) SetPrefix(p string)
- func (wl WrappedLogger) Warn(i ...interface{})
- func (wl WrappedLogger) Warnf(s string, i ...interface{})
- func (wl WrappedLogger) Warnj(j l.JSON)
Constants ¶
const (
PluginsRoot = root + ".plugins"
)
Variables ¶
This section is empty.
Functions ¶
func ErrorHandlerJSON ¶
ErrorHandlerJSON implements JSON content type error handler.
func ErrorHandlerString ¶
ErrorHandlerString implements plain text content type error handler.
func ErrorStatusCode ¶
ErrorStatusCode translates to the respective status code.
Types ¶
type Options ¶
type Options struct { HideBanner bool DisableHTTP2 bool `config:"disableHTTP2"` Port int Type string Protocol string TLS struct { Enabled bool Type string Auto struct { Host string } File struct { Cert string Key string } } `config:"tls"` Json struct { Pretty struct { Enabled bool } } }
Options echo server options.
func NewOptions ¶
NewOptions returns options from config file or environment vars.
func NewOptionsWithPath ¶
NewOptionsWithPath unmarshals a given key path into options and returns it.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a echo server.
func NewServerWithConfigPath ¶
NewServerWithConfigPath returns a new echo server with options from config path.
func NewServerWithOptions ¶
NewServerWithOptions returns a new echo server with options.
func (*Server) Add ¶
func (s *Server) Add(method string, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
Add registers the handler and middlewares for method route at path.
func (*Server) Instance ¶
func (s *Server) Instance() *echo.Echo
Instance returns the wrapped echo server instance.
func (*Server) Match ¶
func (s *Server) Match(methods []string, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) []*echo.Route
Match registers the handler and middlewares for method routes at path.
func (*Server) Pre ¶
func (s *Server) Pre(middleware ...echo.MiddlewareFunc)
Pre registers middlewares that will run before router.
type WrappedLogger ¶
type WrappedLogger struct {
// contains filtered or unexported fields
}
WrappedLogger represents a wrapped logger with util methods.
func WrapLogger ¶
func WrapLogger(l log.Logger) *WrappedLogger
WrapLogger wraps an instace of logger interface.
func (WrappedLogger) Debug ¶
func (wl WrappedLogger) Debug(i ...interface{})
Debug logs a debug message.
func (WrappedLogger) Debugf ¶
func (wl WrappedLogger) Debugf(s string, i ...interface{})
Debugf logs a formatted debug message.
func (WrappedLogger) Error ¶
func (wl WrappedLogger) Error(i ...interface{})
Error logs an error message.
func (WrappedLogger) Errorf ¶
func (wl WrappedLogger) Errorf(s string, i ...interface{})
Errorf logs a formatted error message.
func (WrappedLogger) Fatal ¶
func (wl WrappedLogger) Fatal(i ...interface{})
Fatal logs a fatal message.
func (WrappedLogger) Fatalf ¶
func (wl WrappedLogger) Fatalf(s string, i ...interface{})
Fatalf logs a formatted fatal message.
func (WrappedLogger) Info ¶
func (wl WrappedLogger) Info(i ...interface{})
Warnf logs an info message.
func (WrappedLogger) Infof ¶
func (wl WrappedLogger) Infof(s string, i ...interface{})
Infof logs a formatted info message.
func (WrappedLogger) Output ¶
func (wl WrappedLogger) Output() io.Writer
Output returns logger output writer.
func (WrappedLogger) Panic ¶
func (wl WrappedLogger) Panic(i ...interface{})
Warnj not implemented yet.
func (WrappedLogger) Panicf ¶
func (wl WrappedLogger) Panicf(format string, args ...interface{})
Warnj not implemented yet.
func (WrappedLogger) Printf ¶
func (wl WrappedLogger) Printf(s string, i ...interface{})
Print logs a formatted message.
func (WrappedLogger) SetHeader ¶
func (wl WrappedLogger) SetHeader(h string)
SetHeader not implemented yet.
func (WrappedLogger) SetLevel ¶
func (wl WrappedLogger) SetLevel(v l.Lvl)
SetLevel not implemented yet.
func (WrappedLogger) SetOutput ¶
func (wl WrappedLogger) SetOutput(w io.Writer)
Warnj not implemented yet.
func (WrappedLogger) SetPrefix ¶
func (wl WrappedLogger) SetPrefix(p string)
SetPrefix not implemented yet.
func (WrappedLogger) Warn ¶
func (wl WrappedLogger) Warn(i ...interface{})
Warn logs a warn message.
func (WrappedLogger) Warnf ¶
func (wl WrappedLogger) Warnf(s string, i ...interface{})
Warnf logs a formatted warn message.
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
plugins
|
|
contrib/go.opentelemetry.io/contrib/v0
This package implements integration between echo (https://github.com/labstack/echo) and OpenTelemetry.
|
This package implements integration between echo (https://github.com/labstack/echo) and OpenTelemetry. |