uic

package module
v0.0.0-...-1d01335 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 10 Imported by: 0

README

caddy-uic

This is a plugin to enable the ui composition features of https://github.com/tarent/lib-compose for the https://caddyserver.com.

Example Caddyfile

 uic / http://upstream-host/ {
    fetch layout.html
    fetch http://example.org/navigation
 }

Documentation

Index

Constants

View Source
const DefaultTimeout = time.Second * 10

Variables

View Source
var SecondaryFetchRequestHeaders = []string{
	"Authorization",
	"Cache-Control",
	"Cookie",
	"Pragma",
	"Referer",
	"X-Forwarded-Host",
	"X-Correlation-Id",
	"X-Feature-Toggle",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Path           string
	Upstream       string
	DefaultTimeout time.Duration
	FetchRules     []*Fetch
	Except         []string
}

func NewConfig

func NewConfig(path, upstream string) *Config

func (*Config) AddFetch

func (c *Config) AddFetch(f *Fetch)

type Fetch

type Fetch struct {
	URL     string
	Name    string
	Timeout time.Duration
}

type Uic

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

func NewUic

func NewUic(next httpserver.Handler, config *Config) *Uic

func (*Uic) ServeHTTP

func (h *Uic) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

Jump to

Keyboard shortcuts

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