headers

package
v2.0.0-alpha25 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "headers"

ID contains default service name.

View Source
const RootPluginName = "http"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Headers struct {
		// CORS settings.
		CORS *CORSConfig

		// Request headers to add to every payload send to PHP.
		Request map[string]string

		// Response headers to add to every payload generated by PHP.
		Response map[string]string
	}
}

Config declares headers service configuration.

type Plugin

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

Service serves headers files. Potentially convert into middleware?

func (*Plugin) Init

func (s *Plugin) Init(cfg config.Configurer) error

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

func (*Plugin) Middleware

func (s *Plugin) Middleware(next http.Handler) http.HandlerFunc

middleware must return true if request/response pair is handled within the middleware.

func (*Plugin) Name

func (s *Plugin) Name() string

Jump to

Keyboard shortcuts

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