caddy

package module
v0.0.0-...-4fe54da Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package caddy provides a handler for Caddy Server (https://caddyserver.com/) allowing to turn any web API in a one supporting the Vulcain protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vulcain

type Vulcain struct {
	// Path to an OpenAPI file documenting relations between resources (for non-hypermedia APIs)
	OpenAPIFile string `json:"openapi_file,omitempty"`
	// Maximum number of resources to push
	MaxPushes int `json:"max_pushes,omitempty"`
	// contains filtered or unexported fields
}

Vulcain add suport for the Vulcain protocol (fast and idiomatic client-driven REST APIs) as a Caddy module.

func (Vulcain) CaddyModule

func (Vulcain) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Vulcain) Provision

func (v *Vulcain) Provision(ctx caddy.Context) error

func (Vulcain) ServeHTTP

func (v Vulcain) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP applies Vulcain directives.

func (*Vulcain) UnmarshalCaddyfile

func (v *Vulcain) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the handler from Caddyfile tokens. Syntax:

vulcain {
    # path to the OpenAPI file describing the relations (for non-hypermedia APIs)
    openapi_file <path>
    # Maximum number of pushes to do (-1 for unlimited)
    max_pushes -1
}

Jump to

Keyboard shortcuts

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