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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址