chi

package
v1.0.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Middlewares []func(http.Handler) http.Handler
	Handlers    []ConfigHandler
	Routes      []ConfigRouter
}

type ConfigHandler

type ConfigHandler struct {
	Handler http.Handler
	Pattern string
}

type ConfigRouter

type ConfigRouter struct {
	Method      string
	HandlerFunc http.HandlerFunc
	Pattern     string
}

type Plugin

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

type Server

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

func NewServer

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

func NewServerWithOptions

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

func (*Server) Connect

func (s *Server) Connect(pattern string, handlerFn http.HandlerFunc)

func (*Server) Delete

func (s *Server) Delete(pattern string, handlerFn http.HandlerFunc)

func (*Server) Get

func (s *Server) Get(pattern string, handlerFn http.HandlerFunc)

func (*Server) Group

func (s *Server) Group(fn func(r chi.Router))

func (*Server) Handle

func (s *Server) Handle(pattern string, handler http.Handler)

func (*Server) HandleFunc

func (s *Server) HandleFunc(pattern string, handlerFn http.HandlerFunc)

func (*Server) Head

func (s *Server) Head(pattern string, handlerFn http.HandlerFunc)

func (*Server) HttpServer

func (s *Server) HttpServer() *http.Server

func (*Server) Match

func (s *Server) Match(ctx *chi.Context, method string, path string)

func (*Server) Method

func (s *Server) Method(method string, pattern string, handler http.Handler)

func (*Server) MethodFunc

func (s *Server) MethodFunc(method string, pattern string, handlerFn http.HandlerFunc)

func (*Server) Mux

func (s *Server) Mux() *chi.Mux

func (*Server) Options

func (s *Server) Options(pattern string, handlerFn http.HandlerFunc)

func (*Server) Patch

func (s *Server) Patch(pattern string, handlerFn http.HandlerFunc)

func (*Server) Post

func (s *Server) Post(pattern string, handlerFn http.HandlerFunc)

func (*Server) Put

func (s *Server) Put(pattern string, handlerFn http.HandlerFunc)

func (*Server) Route

func (s *Server) Route(pattern string, fn func(r chi.Router))

func (*Server) Serve

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

func (*Server) Shutdown

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

func (*Server) Trace

func (s *Server) Trace(pattern string, handlerFn http.HandlerFunc)

func (*Server) Use

func (s *Server) Use(middlewares ...func(http.Handler) http.Handler)

func (*Server) With

func (s *Server) With(middlewares ...func(http.Handler) http.Handler) chi.Router

Jump to

Keyboard shortcuts

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