traefik_fallback_plugin

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

traefik-fallback-plugin

traefik-fallback-plugin

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMutex = NewStringKeyLock()

Functions

func New

func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

New created a new Demo plugin.

Types

type CacheRecord added in v0.0.4

type CacheRecord struct {
	Body        []byte
	ContentType string
	ExpiresAt   time.Time
}

func (*CacheRecord) IsExpired added in v0.2.0

func (c *CacheRecord) IsExpired() bool

type Config

type Config struct {
	FallbackOnStatusCodes string `json:"fallbackOnStatusCodes,omitempty"`
	FallbackURL           string `json:"fallbackURL,omitempty"`
	FallbackStatusCode    string `json:"fallbackStatusCode"`
	FallbackContentType   string `json:"fallbackContentType,omitempty"`
	UpstreamTimeout       string `json:"upstreamTimeout,omitempty"`
	CacheTTL              string `json:"cacheTTL,omitempty"`
}

Config the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type Fallback

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

Fallback plugin.

func (*Fallback) ServeHTTP

func (f *Fallback) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type StringKeyLock added in v0.2.0

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

func NewStringKeyLock added in v0.2.0

func NewStringKeyLock() *StringKeyLock

func (*StringKeyLock) Lock added in v0.2.0

func (l *StringKeyLock) Lock(key string)

func (*StringKeyLock) Unlock added in v0.2.0

func (l *StringKeyLock) Unlock(key string)

Jump to

Keyboard shortcuts

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