roadrunner: Index | Files

package headers

import ""


Package Files

config.go service.go


const ID = "headers"

ID contains default service name.

type CORSConfig Uses

type CORSConfig struct {
    // AllowedOrigin:
    AllowedOrigin string

    // AllowedHeaders:
    AllowedHeaders string

    // AllowedMethods:
    AllowedMethods string

    // AllowCredentials
    AllowCredentials *bool

    // ExposeHeaders:
    ExposedHeaders string

    // MaxAge of CORS headers in seconds/
    MaxAge int

CORSConfig headers configuration.

type Config Uses

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 Uses

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

Hydrate service config.

type Service Uses

type Service struct {
    // contains filtered or unexported fields

Service serves headers files. Potentially convert into middleware?

func (*Service) Init Uses

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.

Package headers imports 4 packages (graph) and is imported by 3 packages. Updated 2020-04-06. Refresh now. Tools for package owners.