echo

package
v1.0.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PluginsRoot = root + ".plugins"
)

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func ErrorHandlerJSON

func ErrorHandlerJSON(err error, c e.Context)

ErrorHandlerJSON implements JSON content type error handler.

func ErrorHandlerString

func ErrorHandlerString(err error, c e.Context)

ErrorHandlerString implements plain text content type error handler.

func ErrorStatusCode

func ErrorStatusCode(err error) int

ErrorStatusCode translates to the respective status code. TODO: Move to github.com/americanas-go/errors or github.com/americanas-go/rest-response module.

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
		}
	}
}

func NewOptions

func NewOptions() (*Options, error)

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

type Plugin

type Plugin func(context.Context, *Server) error

type Server

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

func NewServer

func NewServer(ctx context.Context, plugins ...Plugin) *Server

func NewServerWithConfigPath

func NewServerWithConfigPath(ctx context.Context, path string) (*Server, error)

func NewServerWithOptions

func NewServerWithOptions(ctx context.Context, opt *Options, plugins ...Plugin) *Server

func (*Server) Add

func (s *Server) Add(method string, path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) Any

func (s *Server) Any(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) []*echo.Route

func (*Server) CONNECT

func (s *Server) CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) DELETE

func (s *Server) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) File

func (s *Server) File(path, file string, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) GET

func (s *Server) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) Group

func (s *Server) Group(prefix string, m ...echo.MiddlewareFunc) *echo.Group

func (*Server) HEAD

func (s *Server) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) Instance

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

func (*Server) Match

func (s *Server) Match(methods []string, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) []*echo.Route

func (*Server) OPTIONS

func (s *Server) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) Options

func (s *Server) Options() *Options

func (*Server) PATCH

func (s *Server) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) POST

func (s *Server) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) PUT

func (s *Server) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func (*Server) Pre

func (s *Server) Pre(middleware ...echo.MiddlewareFunc)

func (*Server) Serve

func (s *Server) Serve(ctx context.Context)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context)

func (*Server) Static

func (s *Server) Static(prefix, root string) *echo.Route

func (*Server) Use

func (s *Server) Use(middleware ...echo.MiddlewareFunc)

type WrappedLogger

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

func WrapLogger

func WrapLogger(l log.Logger) *WrappedLogger

func (WrappedLogger) Debug

func (wl WrappedLogger) Debug(i ...interface{})

func (WrappedLogger) Debugf

func (wl WrappedLogger) Debugf(s string, i ...interface{})

func (WrappedLogger) Debugj

func (wl WrappedLogger) Debugj(j l.JSON)

func (WrappedLogger) Error

func (wl WrappedLogger) Error(i ...interface{})

func (WrappedLogger) Errorf

func (wl WrappedLogger) Errorf(s string, i ...interface{})

func (WrappedLogger) Errorj

func (wl WrappedLogger) Errorj(j l.JSON)

func (WrappedLogger) Fatal

func (wl WrappedLogger) Fatal(i ...interface{})

func (WrappedLogger) Fatalf

func (wl WrappedLogger) Fatalf(s string, i ...interface{})

func (WrappedLogger) Fatalj

func (wl WrappedLogger) Fatalj(j l.JSON)

func (WrappedLogger) Info

func (wl WrappedLogger) Info(i ...interface{})

func (WrappedLogger) Infof

func (wl WrappedLogger) Infof(s string, i ...interface{})

func (WrappedLogger) Infoj

func (wl WrappedLogger) Infoj(j l.JSON)

func (WrappedLogger) Level

func (wl WrappedLogger) Level() l.Lvl

func (WrappedLogger) Output

func (wl WrappedLogger) Output() io.Writer

func (WrappedLogger) Panic

func (wl WrappedLogger) Panic(i ...interface{})

func (WrappedLogger) Panicf

func (wl WrappedLogger) Panicf(format string, args ...interface{})

func (WrappedLogger) Panicj

func (wl WrappedLogger) Panicj(j l.JSON)

func (WrappedLogger) Prefix

func (wl WrappedLogger) Prefix() string

func (WrappedLogger) Print

func (wl WrappedLogger) Print(i ...interface{})

func (WrappedLogger) Printf

func (wl WrappedLogger) Printf(s string, i ...interface{})

func (WrappedLogger) Printj

func (wl WrappedLogger) Printj(j l.JSON)

func (WrappedLogger) SetHeader

func (wl WrappedLogger) SetHeader(h string)

func (WrappedLogger) SetLevel

func (wl WrappedLogger) SetLevel(v l.Lvl)

func (WrappedLogger) SetOutput

func (wl WrappedLogger) SetOutput(w io.Writer)

func (WrappedLogger) SetPrefix

func (wl WrappedLogger) SetPrefix(p string)

func (WrappedLogger) Warn

func (wl WrappedLogger) Warn(i ...interface{})

func (WrappedLogger) Warnf

func (wl WrappedLogger) Warnf(s string, i ...interface{})

func (WrappedLogger) Warnj

func (wl WrappedLogger) Warnj(j l.JSON)

Jump to

Keyboard shortcuts

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