http

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PluginName declares plugin name.
	PluginName = "http"

	// RrMode RR_HTTP env variable key (internal) if the HTTP presents
	RrMode = "RR_MODE"

	HTTPSScheme = "https"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware interface {
	Middleware(f http.Handler) http.Handler
}

Middleware interface

type Plugin

type Plugin struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Plugin manages pool, http servers. The main http plugin structure

func (*Plugin) AddMiddleware

func (s *Plugin) AddMiddleware(name endure.Named, m Middleware)

AddMiddleware is base requirement for the middleware (name and Middleware)

func (*Plugin) Available added in v2.2.0

func (s *Plugin) Available()

Available interface implementation

func (*Plugin) Collects

func (s *Plugin) Collects() []interface{}

Collects collecting http middlewares

func (*Plugin) Init

func (s *Plugin) Init(cfg config.Configurer, rrLogger logger.Logger, server server.Server) error

Init must return configure svc and return true if svc hasStatus enabled. Must return error in case of misconfiguration. Services must not be used without proper configuration pushed first.

func (*Plugin) Name

func (s *Plugin) Name() string

Name returns endure.Named interface implementation

func (*Plugin) Ready added in v2.0.4

func (s *Plugin) Ready() status.Status

Ready return readiness status of the particular plugin

func (*Plugin) Reset

func (s *Plugin) Reset() error

Reset destroys the old pool and replaces it with new one, waiting for old pool to die

func (*Plugin) Serve

func (s *Plugin) Serve() chan error

Serve serves the svc.

func (*Plugin) ServeHTTP

func (s *Plugin) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles connection using set of middleware and pool PSR-7 server.

func (*Plugin) Status

func (s *Plugin) Status() status.Status

Status return status of the particular plugin

func (*Plugin) Stop

func (s *Plugin) Stop() error

Stop stops the http.

func (*Plugin) Workers

func (s *Plugin) Workers() []process.State

Workers returns slice with the process states for the workers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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