forked from zalando/skipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
builtin.go
111 lines (103 loc) · 2.97 KB
/
builtin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
Package builtin provides a small, generic set of filters.
*/
package builtin
import (
"github.com/zalando/skipper/filters"
"github.com/zalando/skipper/filters/auth"
"github.com/zalando/skipper/filters/circuit"
"github.com/zalando/skipper/filters/cookie"
"github.com/zalando/skipper/filters/cors"
"github.com/zalando/skipper/filters/diag"
"github.com/zalando/skipper/filters/flowid"
"github.com/zalando/skipper/filters/ratelimit"
"github.com/zalando/skipper/filters/tee"
"github.com/zalando/skipper/loadbalancer"
"github.com/zalando/skipper/script"
)
const (
// Deprecated: use setRequestHeader or appendRequestHeader
RequestHeaderName = "requestHeader"
// Deprecated: use setResponseHeader or appendResponseHeader
ResponseHeaderName = "responseHeader"
// Deprecated: use redirectTo
RedirectName = "redirect"
SetRequestHeaderName = "setRequestHeader"
SetResponseHeaderName = "setResponseHeader"
AppendRequestHeaderName = "appendRequestHeader"
AppendResponseHeaderName = "appendResponseHeader"
DropRequestHeaderName = "dropRequestHeader"
DropResponseHeaderName = "dropResponseHeader"
HealthCheckName = "healthcheck"
ModPathName = "modPath"
SetPathName = "setPath"
RedirectToName = "redirectTo"
RedirectToLowerName = "redirectToLower"
StaticName = "static"
StripQueryName = "stripQuery"
PreserveHostName = "preserveHost"
StatusName = "status"
CompressName = "compress"
SetQueryName = "setQuery"
DropQueryName = "dropQuery"
InlineContentName = "inlineContent"
)
// Returns a Registry object initialized with the default set of filter
// specifications found in the filters package. (including the builtin
// and the flowid subdirectories.)
func MakeRegistry() filters.Registry {
r := make(filters.Registry)
for _, s := range []filters.Spec{
NewRequestHeader(),
NewSetRequestHeader(),
NewAppendRequestHeader(),
NewDropRequestHeader(),
NewResponseHeader(),
NewSetResponseHeader(),
NewAppendResponseHeader(),
NewDropResponseHeader(),
NewModPath(),
NewSetPath(),
NewDropQuery(),
NewSetQuery(),
NewHealthCheck(),
NewStatic(),
NewRedirect(),
NewRedirectTo(),
NewRedirectLower(),
NewStripQuery(),
NewInlineContent(),
flowid.New(),
PreserveHost(),
NewStatus(),
NewCompress(),
NewCopyRequestHeader(),
NewCopyResponseHeader(),
diag.NewRandom(),
diag.NewLatency(),
diag.NewBandwidth(),
diag.NewChunks(),
diag.NewBackendLatency(),
diag.NewBackendBandwidth(),
diag.NewBackendChunks(),
tee.NewTee(),
tee.NewTeeDeprecated(),
tee.NewTeeNoFollow(),
auth.NewBasicAuth(),
cookie.NewRequestCookie(),
cookie.NewResponseCookie(),
cookie.NewJSCookie(),
circuit.NewConsecutiveBreaker(),
circuit.NewRateBreaker(),
circuit.NewDisableBreaker(),
ratelimit.NewLocalRatelimit(),
ratelimit.NewRatelimit(),
ratelimit.NewDisableRatelimit(),
loadbalancer.NewDecide(),
script.NewLuaScript(),
cors.NewOrigin(),
} {
r.Register(s)
}
return r
}