headers

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

View Source
const ID = "headers"

ID contains default service name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config 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.

func (*Config) Hydrate

func (c *Config) Hydrate(cfg service.Config) error

Hydrate service config.

type Service

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

Service serves headers files. Potentially convert into middleware?

func (*Service) Init

func (s *Service) Init(cfg *Config, r *rrhttp.Service) (bool, 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.

Jump to

Keyboard shortcuts

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