proxy

package
v0.0.0-...-094c82b Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHtmlIfNoExtensionAndNotFound

func AddHtmlIfNoExtensionAndNotFound() func(next http.Handler) http.Handler

func AddTrailingSlashIfNoExtensionAndNotFound

func AddTrailingSlashIfNoExtensionAndNotFound(target *url.URL) func(next http.Handler) http.Handler

func CheckUrlExists

func CheckUrlExists(target *url.URL) (int, error)

func CheckUrlMD5

func CheckUrlMD5(target *url.URL) (string, error)

func GetUrlFromRequest

func GetUrlFromRequest(req *http.Request) *url.URL

func Md5Cache

func Md5Cache(target *url.URL) func(next http.Handler) http.Handler

func NewStorageContainerReverseProxy

func NewStorageContainerReverseProxy(target *url.URL) *httputil.ReverseProxy

func RedirectAssetsByExtension

func RedirectAssetsByExtension(target *url.URL, extensions []string) func(http.Handler) http.Handler

func SubdomainAsSubpath

func SubdomainAsSubpath(domain string, env string) func(http.Handler) http.Handler

func TryDefaultEnvOnNotFound

func TryDefaultEnvOnNotFound(defaultEnv string) func(next http.Handler) http.Handler

func TryIndexOnNotFound

func TryIndexOnNotFound() func(next http.Handler) http.Handler

Types

type CachedResponse

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

type CachedResponseWriter

type CachedResponseWriter struct {
	StatusCode int

	Buffer bytes.Buffer
	// contains filtered or unexported fields
}

func NewCachedResponseWriter

func NewCachedResponseWriter() *CachedResponseWriter

func (*CachedResponseWriter) Header

func (srrw *CachedResponseWriter) Header() http.Header

func (*CachedResponseWriter) Write

func (srrw *CachedResponseWriter) Write(bytes []byte) (int, error)

func (*CachedResponseWriter) WriteHeader

func (srrw *CachedResponseWriter) WriteHeader(code int)

func (CachedResponseWriter) WriteTo

func (srrw CachedResponseWriter) WriteTo(res http.ResponseWriter) error

type Config

type Config struct {
	AzureStorageAccount   string
	AzureStorageContainer string
	BaseDomain            string
	DefaultEnv            string
	UseSubdomains         bool
}

type ResponseCache

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

func NewMd5ResponseCache

func NewMd5ResponseCache(entryLifetime time.Duration) *ResponseCache

type StorageContainerProxyHandler

type StorageContainerProxyHandler struct {
	AzureStorageAccount   string
	AzureStorageContainer string
	BaseDomain            string
	DefaultEnv            string
	UseSubdomains         bool
	Target                *url.URL
}

func NewHandler

func NewHandler(config *Config) StorageContainerProxyHandler

func (*StorageContainerProxyHandler) Listen

func (scp *StorageContainerProxyHandler) Listen()

Jump to

Keyboard shortcuts

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