Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/caddyserver/caddy
/ functions
Functions
2,647 in github.com/caddyserver/caddy
⨍
Functions
2,647
◇
Types & classes
525
↓ 16 callers
Method
Bool
Bool returns the boolean representation of the flag given by name. It returns false if the flag is not a boolean type. It panics if the flag is not in
cmd/main.go:320
↓ 16 callers
Method
NewFromNextSegment
NewFromNextSegment returns a new dispenser with a copy of the tokens from the current token until the end of the "directive" whether that be to the en
caddyconfig/caddyfile/dispenser.go:351
↓ 16 callers
Method
Select
Select returns an available host, if any.
modules/caddyhttp/reverseproxy/selectionpolicies.go:131
↓ 16 callers
Method
UnmarshalCaddyfile
(d *Dispenser)
caddyconfig/caddyfile/adapter.go:107
↓ 16 callers
Function
WrapCommandFuncForCobra
WrapCommandFuncForCobra wraps a Caddy CommandFunc for use in a cobra command's RunE field.
cmd/cobra.go:149
↓ 15 callers
Function
CELMatcherImpl
CELMatcherImpl creates a new cel.Library based on the following pieces of data: - macroName: the function name to be used within CEL. This will be a
modules/caddyhttp/celmatcher.go:391
↓ 15 callers
Method
Close
()
modules/caddyhttp/reverseproxy/reverseproxy.go:1816
↓ 15 callers
Method
Do
Do makes the request and returns an io.Reader that translates the data read from the FastCGI responder out of FastCGI packets before returning it.
modules/caddyhttp/reverseproxy/fastcgi/client.go:140
↓ 15 callers
Method
Healthy
Healthy returns true if the remote host is currently known to be healthy or "up". It consults the circuit breaker, if any.
modules/caddyhttp/reverseproxy/hosts.go:85
↓ 15 callers
Method
PortRangeSize
PortRangeSize returns how many ports are in pa's port range. Port ranges are inclusive, so the size is the difference of start and end ports plus one.
listeners.go:251
↓ 15 callers
Function
RegisterCommand
RegisterCommand registers the command cmd. cmd.Name must be unique and conform to the following format: - lowercase - ASCII lowercase letters, digits
cmd/commands.go:578
↓ 15 callers
Function
determineTrustedProxy
determineTrustedProxy parses the remote IP address of the request, and determines (if the server configured it) if the client is a trusted proxy. If t
modules/caddyhttp/server.go:1029
↓ 15 callers
Function
specificity
specificity returns len(s) minus any wildcards (*) and placeholders ({...}). Basically, it's a length count that penalizes the use of wildcards and pl
caddyconfig/httpcaddyfile/httptype.go:1726
↓ 15 callers
Function
testPool
()
modules/caddyhttp/reverseproxy/selectionpolicies_test.go:28
↓ 14 callers
Method
Error
()
cmd/cobra.go:166
↓ 14 callers
Function
NewDispenser
NewDispenser returns a Dispenser filled with the given tokens.
caddyconfig/caddyfile/dispenser.go:40
↓ 14 callers
Function
RegisterDirective
RegisterDirective registers a unique directive dir with an associated unmarshaling (setup) function. When directive dir is encountered in a Caddyfile,
caddyconfig/httpcaddyfile/directives.go:109
↓ 14 callers
Method
String
()
cmd/packagesfuncs.go:349
↓ 13 callers
Method
Adapt
Adapt converts the Caddyfile config in body to Caddy JSON.
caddyconfig/caddyfile/adapter.go:32
↓ 13 callers
Method
AssertResponse
AssertResponse requests a URI and asserts the status code and body.
caddytest/caddytest.go:522
↓ 13 callers
Method
DeleteN
DeleteN is the same as Delete, but can delete many tokens at once. If there aren't N tokens available to delete, none are deleted.
caddyconfig/caddyfile/dispenser.go:465
↓ 13 callers
Method
IsFdNetwork
IsFdNetwork returns true if na.Network is fd or fdgram.
listeners.go:215
↓ 12 callers
Method
AddString
AddString is part of the zapcore.ObjectEncoder interface.
modules/logging/nopencoder.go:74
↓ 12 callers
Method
App
App returns the configured app named name. If that app has not yet been loaded and provisioned, it will be immediately loaded and provisioned. If no a
context.go:505
↓ 12 callers
Method
ConvertToNative
(typeDesc reflect.Type)
modules/caddyhttp/celmatcher.go:326
↓ 12 callers
Method
File
File gets the filename where the current token originated.
caddyconfig/caddyfile/dispenser.go:259
↓ 12 callers
Method
ID
()
caddy.go:1150
↓ 12 callers
Function
NewResponseRecorder
NewResponseRecorder returns a new ResponseRecorder that can be used instead of a standard http.ResponseWriter. The recorder is useful for middlewares
modules/caddyhttp/responsewriter.go:137
↓ 12 callers
Method
Size
()
modules/caddyhttp/responsewriter.go:322
↓ 12 callers
Method
Validate
()
modules.go:306
↓ 12 callers
Function
getContextOrFail
(t *testing.T)
modules/caddyhttp/templates/tplcontext_test.go:684
↓ 12 callers
Function
newMetricsInstrumentedRoute
(ctx caddy.Context, handler string, next Handler, m *Metrics)
modules/caddyhttp/metrics.go:306
↓ 12 callers
Function
trustedRealClientIP
trustedRealClientIP finds the client IP from the request assuming it is from a trusted client. If there is no client IP headers, then the direct remot
modules/caddyhttp/server.go:1091
↓ 11 callers
Method
Equal
(x crypto.PublicKey)
admin_test.go:62
↓ 11 callers
Function
NewReplacer
NewReplacer returns a new Replacer.
replacer.go:34
↓ 11 callers
Method
NewRoute
NewRoute returns config values relevant to creating a new HTTP route.
caddyconfig/httpcaddyfile/directives.go:280
↓ 11 callers
Method
Open
(name string)
internal/filesystems/os.go:18
↓ 11 callers
Method
OpenWriter
OpenWriter opens a new file writer.
modules/logging/filewriter.go:187
↓ 11 callers
Method
String
()
modules/caddyhttp/reverseproxy/upstreams.go:435
↓ 11 callers
Method
Write
(p []byte)
modules/caddyhttp/reverseproxy/fastcgi/writer.go:46
↓ 11 callers
Method
fillDynamicHost
fillDynamicHost is like fillHost, but stores the host in the separate dynamicHosts map rather than the reference-counted UsagePool. Dynamic hosts are
modules/caddyhttp/reverseproxy/hosts.go:143
↓ 11 callers
Function
newPassiveHandler
newPassiveHandler builds a minimal Handler with passive health checks configured and a live caddy.Context so the fail-forgetter goroutine can be cance
modules/caddyhttp/reverseproxy/passive_health_test.go:28
↓ 11 callers
Method
provisionUpstream
(upstream *Upstream, dynamic bool)
modules/caddyhttp/reverseproxy/reverseproxy.go:1428
↓ 11 callers
Function
testParser
(input string)
caddyconfig/caddyfile/parse_test.go:1034
↓ 10 callers
Method
AssertRedirect
AssertRedirect makes a request and asserts the redirection happens
caddytest/caddytest.go:376
↓ 10 callers
Function
CaddyfileHeaderOp
CaddyfileHeaderOp applies a new header operation according to field, value, and replacement. The field can be prefixed with "+" or "-" to specify addi
modules/caddyhttp/headers/caddyfile.go:221
↓ 10 callers
Method
Clone
Clone returns a deep copy of the token.
caddyconfig/caddyfile/lexer.go:363
↓ 10 callers
Method
Close
Close writes any remaining buffered response and deallocates any active resources.
modules/caddyhttp/encode/encode.go:415
↓ 10 callers
Method
GetKeysText
()
caddyconfig/caddyfile/parse.go:784
↓ 10 callers
Method
JSON
JSON converts val into JSON. Any errors are added to warnings.
caddyconfig/httpcaddyfile/directives.go:242
↓ 10 callers
Function
NewTestReplacer
NewTestReplacer creates a replacer for an http.Request for use in tests that are not in this package
modules/caddyhttp/replacer.go:50
↓ 10 callers
Function
addHTTPVarsToReplacer
(repl *caddy.Replacer, req *http.Request, w http.ResponseWriter)
modules/caddyhttp/replacer.go:58
↓ 10 callers
Function
prepareTestRequest
prepareTestRequest injects the context values that ServeHTTP and proxyLoopIteration require (caddy.ReplacerCtxKey, VarsCtxKey, etc.) using the same he
modules/caddyhttp/reverseproxy/retries_test.go:28
↓ 9 callers
Method
Clone
Clone is part of the zapcore.ObjectEncoder interface. We don't use it as of Oct 2019 (v2 beta 7), I'm not really sure what it'd be useful for in our c
modules/logging/nopencoder.go:106
↓ 9 callers
Method
Flush
()
modules/caddyhttp/encode/encode.go:575
↓ 9 callers
Method
GetMetricsRegistry
Returns the active metrics registry for the context EXPERIMENTAL: This API is subject to change.
context.go:115
↓ 9 callers
Method
Select
Select returns an available host, if any.
modules/caddyhttp/reverseproxy/selectionpolicies.go:489
↓ 9 callers
Method
String
()
modules/logging/netwriter.go:83
↓ 9 callers
Method
parseAll
()
caddyconfig/caddyfile/parse.go:122
↓ 9 callers
Function
sendFcgi
(reqType int, fcgiParams map[string]string, data []byte, posts map[string]string, files map[string]string)
modules/caddyhttp/reverseproxy/fastcgi/client_test.go:119
↓ 8 callers
Method
Available
Available returns true if the remote host is available to receive requests. This is the method that should be used by selection policies, etc. to dete
modules/caddyhttp/reverseproxy/hosts.go:78
↓ 8 callers
Method
CertMagicStorage
()
storage.go:32
↓ 8 callers
Method
Delete
Delete deletes the current token and returns the updated slice of tokens. The cursor is not advanced to the next token. Because deletion modifies the
caddyconfig/caddyfile/dispenser.go:455
↓ 8 callers
Method
ExtractMatcherSet
ExtractMatcherSet is like MatcherToken, except this is a higher-level method that returns the matcher set described by the matcher token, or nil if th
caddyconfig/httpcaddyfile/directives.go:262
↓ 8 callers
Method
Filter
Filter filters the input field.
modules/logging/filters.go:243
↓ 8 callers
Method
GetACMEIssuer
()
caddyconfig/httpcaddyfile/tlsapp.go:514
↓ 8 callers
Function
GetAdapter
GetAdapter returns the adapter with the given name, or nil if one with that name is not registered.
caddyconfig/configadapters.go:121
↓ 8 callers
Function
SanitizedPathJoin
SanitizedPathJoin performs filepath.Join(root, reqPath) that is safe against directory traversal attacks. It uses logic similar to that in the Go stan
modules/caddyhttp/caddyhttp.go:252
↓ 8 callers
Method
String
Lazy generates UUID string or return cached value if present
modules/caddyhttp/replacer.go:572
↓ 8 callers
Method
Type
()
modules/caddyhttp/celmatcher.go:343
↓ 8 callers
Method
handleError
(w http.ResponseWriter, r *http.Request, err error)
admin.go:885
↓ 8 callers
Function
minimalHandlerWithRetryMatch
minimalHandlerWithRetryMatch is like minimalHandler but also configures RetryMatch so that response-based retry can be tested
modules/caddyhttp/reverseproxy/retries_test.go:276
↓ 8 callers
Method
protocol
protocol returns true if the protocol proto is configured/enabled.
modules/caddyhttp/server.go:915
↓ 7 callers
Method
AddOperation
AddOperation adds a single regexp operation to the filter with validation. This is used when merging multiple RegexpFilter instances.
modules/logging/filters.go:824
↓ 7 callers
Method
AssertPostResponseBody
AssertPostResponseBody requests a URI with POST and asserts the response code and body.
caddytest/caddytest.go:569
↓ 7 callers
Method
Close
()
modules/caddyhttp/reverseproxy/fastcgi/client.go:193
↓ 7 callers
Method
CompileOptions
()
modules/caddyhttp/celmatcher.go:457
↓ 7 callers
Method
GetString
GetString is the same as Get, but coerces the value to a string representation as efficiently as possible.
replacer.go:111
↓ 7 callers
Method
Int
Int returns the integer representation of the flag given by name. It returns 0 if the flag is not an integer type. It panics if the flag is not in the
cmd/main.go:329
↓ 7 callers
Function
IsUnixNetwork
IsUnixNetwork returns true if the netw is a unix network.
listeners.go:299
↓ 7 callers
Method
IsValid
()
modules/logging/filters.go:298
↓ 7 callers
Method
NewEncoder
()
modules/caddyhttp/encode/encode.go:582
↓ 7 callers
Function
PrivateRangesCIDR
PrivateRangesCIDR returns a list of private CIDR range strings, which can be used as a configuration shortcut.
internal/ranges.go:5
↓ 7 callers
Method
ProgramOptions
()
modules/caddyhttp/celmatcher.go:461
↓ 7 callers
Method
Provision
Provision compiles all regexp patterns with security validation.
modules/logging/filters.go:728
↓ 7 callers
Function
RegisterModule
RegisterModule registers a module by receiving a plain/empty value of the module. For registration to be properly recorded, this should be called in t
modules.go:138
↓ 7 callers
Method
Select
Select returns an available host, if any.
modules/caddyhttp/reverseproxy/selectionpolicies.go:440
↓ 7 callers
Method
Select
Select returns an available host, if any.
modules/caddyhttp/reverseproxy/selectionpolicies.go:654
↓ 7 callers
Function
allNew
(upstreams []Upstream)
modules/caddyhttp/reverseproxy/upstreams.go:551
↓ 7 callers
Function
assertPlaceholderAbsent
(t *testing.T, repl *caddy.Replacer, key string)
modules/caddyhttp/caddyauth/caddyauth_test.go:182
↓ 7 callers
Function
callAdminUpstreams
callAdminUpstreams fires a GET against handleUpstreams and returns the decoded response body.
modules/caddyhttp/reverseproxy/admin_test.go:60
↓ 7 callers
Function
newExpressionMatcher
newExpressionMatcher provisions a MatchExpression for use in tests
modules/caddyhttp/reverseproxy/retries_test.go:263
↓ 6 callers
Method
Adapt
(body []byte, options map[string]any)
caddyconfig/configadapters.go:27
↓ 6 callers
Method
AddUint16
AddUint16 is part of the zapcore.ObjectEncoder interface.
modules/logging/nopencoder.go:89
↓ 6 callers
Method
AppIfConfigured
AppIfConfigured is like App, but it returns an error if the app has not been configured. This is useful when the app is required and its absence is a
context.go:530
↓ 6 callers
Method
AssertResponseCode
AssertResponseCode will execute the request and verify the status code, returns a response for additional assertions
caddytest/caddytest.go:506
↓ 6 callers
Method
Buffered
()
modules/caddyhttp/responsewriter.go:321
↓ 6 callers
Function
CleanPath
CleanPath cleans path p according to path.Clean(), but only merges repeated slashes if collapseSlashes is true, and always preserves trailing slashes.
modules/caddyhttp/caddyhttp.go:279
↓ 6 callers
Method
Directive
Directive returns the directive name for the segment. The directive name is the text of the first token.
caddyconfig/caddyfile/parse.go:811
↓ 6 callers
Method
Filter
Filter applies all regexp operations sequentially to the input field. Input is sanitized and validated for security.
modules/logging/filters.go:785
← previous
next →
101–200 of 2,647, ranked by callers