Skip to content

Commit 2fba548

Browse files
committed
Move type and const down to the bottom
1 parent f04b771 commit 2fba548

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

modules/caddyhttp/reverseproxy/reverseproxy.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -266,29 +266,6 @@ type Handler struct {
266266
streamLogLoggerName string
267267
}
268268

269-
// StreamLogs controls logging for upgraded stream lifecycle events.
270-
type StreamLogs struct {
271-
// The minimum level at which stream lifecycle events are logged.
272-
// Supported values are debug, info, warn, and error. Default: debug.
273-
Level string `json:"level,omitempty"`
274-
275-
// Logger name for stream lifecycle logs. Default: "http.handlers.reverse_proxy.stream".
276-
// Special value "access" uses the access logger namespace and, if set,
277-
// respects the first value in access_logger_names/log_name for the request.
278-
LoggerName string `json:"logger_name,omitempty"`
279-
280-
// If true, suppresses the access log entry normally emitted when an
281-
// upgraded stream handshake completes and the request unwinds.
282-
SkipHandshake bool `json:"skip_handshake,omitempty"`
283-
}
284-
285-
const (
286-
defaultStreamLogLevel = zapcore.DebugLevel
287-
defaultStreamLoggerName = "http.handlers.reverse_proxy.stream"
288-
streamLoggerNameUseAccess = "access"
289-
defaultAccessLoggerBase = "http.log.access"
290-
)
291-
292269
// CaddyModule returns the Caddy module information.
293270
func (Handler) CaddyModule() caddy.ModuleInfo {
294271
return caddy.ModuleInfo{
@@ -1813,6 +1790,22 @@ func (brc bodyReadCloser) Close() error {
18131790
return nil
18141791
}
18151792

1793+
// StreamLogs controls logging for upgraded stream lifecycle events.
1794+
type StreamLogs struct {
1795+
// The minimum level at which stream lifecycle events are logged.
1796+
// Supported values are debug, info, warn, and error. Default: debug.
1797+
Level string `json:"level,omitempty"`
1798+
1799+
// Logger name for stream lifecycle logs. Default: "http.handlers.reverse_proxy.stream".
1800+
// Special value "access" uses the access logger namespace and, if set,
1801+
// respects the first value in access_logger_names/log_name for the request.
1802+
LoggerName string `json:"logger_name,omitempty"`
1803+
1804+
// If true, suppresses the access log entry normally emitted when an
1805+
// upgraded stream handshake completes and the request unwinds.
1806+
SkipHandshake bool `json:"skip_handshake,omitempty"`
1807+
}
1808+
18161809
// bufPool is used for buffering requests and responses.
18171810
var bufPool = sync.Pool{
18181811
New: func() any {
@@ -1858,6 +1851,13 @@ const proxyHandleResponseContextCtxKey caddy.CtxKey = "reverse_proxy_handle_resp
18581851
// errNoUpstream occurs when there are no upstream available.
18591852
var errNoUpstream = fmt.Errorf("no upstreams available")
18601853

1854+
const (
1855+
defaultStreamLogLevel = zapcore.DebugLevel
1856+
defaultStreamLoggerName = "http.handlers.reverse_proxy.stream"
1857+
streamLoggerNameUseAccess = "access"
1858+
defaultAccessLoggerBase = "http.log.access"
1859+
)
1860+
18611861
// Interface guards
18621862
var (
18631863
_ caddy.Provisioner = (*Handler)(nil)

0 commit comments

Comments
 (0)