rest

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler added in v1.6.0

type Handler interface {
	Handle(*router.Request, router.Context, *Pipeline) (*router.Response, error)
}

type HandlerFunc added in v1.6.0

type HandlerFunc func(*router.Request, router.Context, *Pipeline) (*router.Response, error)

func (HandlerFunc) Handle added in v1.6.0

func (f HandlerFunc) Handle(req *router.Request, cxt router.Context, next *Pipeline) (*router.Response, error)

type Option

type Option func(s *Service) (*Service, error)

func WithDebug

func WithDebug(on bool) Option

func WithHandlers added in v1.6.0

func WithHandlers(v ...Handler) Option

func WithLogger

func WithLogger(l *logrus.Logger) Option

func WithMetrics added in v1.3.0

func WithMetrics(m *metrics.Metrics) Option

func WithVerbose

func WithVerbose(on bool) Option

type Pipeline added in v1.6.0

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

func (*Pipeline) Handle added in v1.6.0

func (c *Pipeline) Handle(req *router.Request, cxt router.Context) (*router.Response, error)

func (*Pipeline) Len added in v1.6.0

func (c *Pipeline) Len() int

func (*Pipeline) Next added in v1.6.0

func (c *Pipeline) Next() Handler

func (*Pipeline) With added in v1.6.0

func (c *Pipeline) With(h ...Handler) *Pipeline

type Service

type Service struct {
	router.Router
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Service, error)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, req *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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