Documentation ¶
Overview ¶
Caddy plugin to serve Python apps.
Index ¶
- type AppServer
- type Asgi
- type AsgiOperations
- type AsgiRequestHandler
- type CaddySnake
- func (CaddySnake) CaddyModule() caddy.ModuleInfo
- func (m *CaddySnake) Cleanup() error
- func (f *CaddySnake) Provision(ctx caddy.Context) error
- func (f CaddySnake) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (f *CaddySnake) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (m *CaddySnake) Validate() error
- type Wsgi
- type WsgiRequestHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppServer ¶ added in v0.0.6
type AppServer interface { Cleanup() error HandleRequest(w http.ResponseWriter, r *http.Request) error }
AppServer defines the interface to interacting with a WSGI or ASGI server
type Asgi ¶ added in v0.0.6
type Asgi struct {
// contains filtered or unexported fields
}
Asgi stores a reference to a Python Asgi application
func (*Asgi) HandleRequest ¶ added in v0.0.6
HandleRequest passes request down to Python ASGI app and writes responses and headers.
type AsgiOperations ¶ added in v0.0.6
type AsgiOperations struct {
// contains filtered or unexported fields
}
AsgiOperations stores operations that should be executed in the background
type AsgiRequestHandler ¶ added in v0.0.6
type AsgiRequestHandler struct {
// contains filtered or unexported fields
}
AsgiRequestHandler stores pointers to the request and the response writer
func NewAsgiRequestHandler ¶ added in v0.0.6
func NewAsgiRequestHandler(w http.ResponseWriter, r *http.Request) *AsgiRequestHandler
NewAsgiRequestHandler initializes handler and starts queue that consumes operations in the background.
type CaddySnake ¶
type CaddySnake struct { ModuleWsgi string `json:"module_wsgi,omitempty"` ModuleAsgi string `json:"module_asgi,omitempty"` Lifespan string `json:"lifespan,omitempty"` VenvPath string `json:"venv_path,omitempty"` // contains filtered or unexported fields }
CaddySnake module that communicates with a Python app
func (CaddySnake) CaddyModule ¶
func (CaddySnake) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*CaddySnake) Cleanup ¶
func (m *CaddySnake) Cleanup() error
Cleanup frees resources uses by module
func (*CaddySnake) Provision ¶
func (f *CaddySnake) Provision(ctx caddy.Context) error
Provision sets up the module.
func (CaddySnake) ServeHTTP ¶
func (f CaddySnake) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
ServeHTTP implements caddyhttp.MiddlewareHandler.
func (*CaddySnake) UnmarshalCaddyfile ¶
func (f *CaddySnake) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
func (*CaddySnake) Validate ¶
func (m *CaddySnake) Validate() error
Validate implements caddy.Validator.
type Wsgi ¶
type Wsgi struct {
// contains filtered or unexported fields
}
Wsgi stores a reference to a Python Wsgi application
func (*Wsgi) HandleRequest ¶
HandleRequest passes request down to Python Wsgi app and writes responses and headers.
type WsgiRequestHandler ¶ added in v0.0.6
type WsgiRequestHandler struct {
// contains filtered or unexported fields
}
WsgiRequestHandler tracks the state of a HTTP request to a WSGI App