Variable CaddyHandlerSchemaConst
CaddyHandlerSchema: ZodUnion<
[
ZodDiscriminatedUnion<
"handler",
[
ZodObject<
{
flush_interval: ZodOptional<ZodUnion<[ZodNumber, ZodString]>>;
handler: ZodLiteral<"reverse_proxy">;
headers: ZodOptional<
ZodObject<
{
request: ZodOptional<
ZodObject<(...), (...), (...), (...), (...)>,
>;
response: ZodOptional<ZodObject<(...), (...), (...), (...), (...)>>;
},
"strip",
ZodTypeAny,
{
request?: { add?: ...; delete?: ...; set?: ... };
response?: { add?: ...; delete?: ...; set?: ... };
},
{
request?: { add?: ...; delete?: ...; set?: ... };
response?: { add?: ...; delete?: ...; set?: ... };
},
>,
>;
health_checks: ZodOptional<
ZodObject<
{
active: ZodOptional<
ZodObject<(...), (...), (...), (...), (...)>,
>;
passive: ZodOptional<ZodObject<(...), (...), (...), (...), (...)>>;
},
"strip",
ZodTypeAny,
{
active?: {
expect_body?: ...;
expect_status?: ...;
fails?: ...;
follow_redirects?: ...;
headers?: ...;
interval?: ...;
max_size?: ...;
passes?: ...;
path?: ...;
port?: ...;
timeout?: ...;
uri?: ...;
};
passive?: {
fail_duration?: ...;
max_fails?: ...;
unhealthy_latency?: ...;
unhealthy_request_count?: ...;
unhealthy_status?: ...;
};
},
{
active?: {
expect_body?: ...;
expect_status?: ...;
fails?: ...;
follow_redirects?: ...;
headers?: ...;
interval?: ...;
max_size?: ...;
passes?: ...;
path?: ...;
port?: ...;
timeout?: ...;
uri?: ...;
};
passive?: {
fail_duration?: ...;
max_fails?: ...;
unhealthy_latency?: ...;
unhealthy_request_count?: ...;
unhealthy_status?: ...;
};
},
>,
>;
load_balancing: ZodOptional<
ZodObject<
{
retries: ZodOptional<ZodNumber>;
selection_policy: ZodOptional<
ZodObject<(...), (...), (...), (...), (...)>,
>;
try_duration: ZodOptional<ZodUnion<(...)>>;
try_interval: ZodOptional<ZodUnion<(...)>>;
},
"strip",
ZodTypeAny,
{
retries?: number;
selection_policy?: objectOutputType<(...), (...), (...)>;
try_duration?: string | number;
try_interval?: string | number;
},
{
retries?: number;
selection_policy?: objectInputType<(...), (...), (...)>;
try_duration?: string | number;
try_interval?: string | number;
},
>,
>;
request_buffers: ZodOptional<ZodNumber>;
response_buffers: ZodOptional<ZodNumber>;
transport: ZodOptional<
ZodObject<
{ protocol: ZodString },
"passthrough",
ZodTypeAny,
objectOutputType<{ protocol: ZodString }, ZodTypeAny, "passthrough">,
objectInputType<{ protocol: ZodString }, ZodTypeAny, "passthrough">,
>,
>;
upstreams: ZodOptional<
ZodArray<
ZodObject<
{ dial: ZodString; max_requests: ZodOptional<(...)> },
"strip",
ZodTypeAny,
{ dial: string; max_requests?: (...) | (...) },
{ dial: string; max_requests?: (...) | (...) },
>,
"many",
>,
>;
},
"strip",
ZodTypeAny,
{
flush_interval?: string
| number;
handler: "reverse_proxy";
headers?: {
request?: {
add?: (...) | (...);
delete?: (...) | (...);
set?: (...) | (...);
};
response?: {
add?: (...)
| (...);
delete?: (...) | (...);
set?: (...) | (...);
};
};
health_checks?: {
active?: {
expect_body?: (...)
| (...);
expect_status?: (...) | (...);
fails?: (...) | (...);
follow_redirects?: (...) | (...) | (...);
headers?: (...) | (...);
interval?: (...) | (...) | (...);
max_size?: (...) | (...);
passes?: (...) | (...);
path?: (...) | (...);
port?: (...) | (...);
timeout?: (...) | (...) | (...);
uri?: (...) | (...);
};
passive?: {
fail_duration?: (...)
| (...)
| (...);
max_fails?: (...) | (...);
unhealthy_latency?: (...) | (...) | (...);
unhealthy_request_count?: (...) | (...);
unhealthy_status?: (...) | (...);
};
};
load_balancing?: {
retries?: number;
selection_policy?: objectOutputType<
{ policy: ... },
ZodTypeAny,
"passthrough",
>;
try_duration?: string | number;
try_interval?: string | number;
};
request_buffers?: number;
response_buffers?: number;
transport?: objectOutputType<
{ protocol: ZodString },
ZodTypeAny,
"passthrough",
>;
upstreams?: { dial: string; max_requests?: number }[];
},
{
flush_interval?: string
| number;
handler: "reverse_proxy";
headers?: {
request?: {
add?: (...) | (...);
delete?: (...) | (...);
set?: (...) | (...);
};
response?: {
add?: (...)
| (...);
delete?: (...) | (...);
set?: (...) | (...);
};
};
health_checks?: {
active?: {
expect_body?: (...)
| (...);
expect_status?: (...) | (...);
fails?: (...) | (...);
follow_redirects?: (...) | (...) | (...);
headers?: (...) | (...);
interval?: (...) | (...) | (...);
max_size?: (...) | (...);
passes?: (...) | (...);
path?: (...) | (...);
port?: (...) | (...);
timeout?: (...) | (...) | (...);
uri?: (...) | (...);
};
passive?: {
fail_duration?: (...)
| (...)
| (...);
max_fails?: (...) | (...);
unhealthy_latency?: (...) | (...) | (...);
unhealthy_request_count?: (...) | (...);
unhealthy_status?: (...) | (...);
};
};
load_balancing?: {
retries?: number;
selection_policy?: objectInputType<
{ policy: ... },
ZodTypeAny,
"passthrough",
>;
try_duration?: string | number;
try_interval?: string | number;
};
request_buffers?: number;
response_buffers?: number;
transport?: objectInputType<
{ protocol: ZodString },
ZodTypeAny,
"passthrough",
>;
upstreams?: { dial: string; max_requests?: number }[];
},
>,
ZodObject<
{
handler: ZodLiteral<"headers">;
request: ZodOptional<
ZodObject<
{
add: ZodOptional<ZodRecord<(...), (...)>>;
delete: ZodOptional<ZodArray<(...), (...)>>;
set: ZodOptional<ZodRecord<(...), (...)>>;
},
"strip",
ZodTypeAny,
{
add?: Record<(...), (...)>;
delete?: (...)[];
set?: Record<(...), (...)>;
},
{
add?: Record<(...), (...)>;
delete?: (...)[];
set?: Record<(...), (...)>;
},
>,
>;
response: ZodOptional<
ZodObject<
{
add: ZodOptional<ZodRecord<(...), (...)>>;
deferred: ZodOptional<ZodBoolean>;
delete: ZodOptional<ZodArray<(...), (...)>>;
set: ZodOptional<ZodRecord<(...), (...)>>;
},
"strip",
ZodTypeAny,
{
add?: Record<(...), (...)>;
deferred?: boolean;
delete?: (...)[];
set?: Record<(...), (...)>;
},
{
add?: Record<(...), (...)>;
deferred?: boolean;
delete?: (...)[];
set?: Record<(...), (...)>;
},
>,
>;
},
"strip",
ZodTypeAny,
{
handler: "headers";
request?: {
add?: Record<string, (...)[]>;
delete?: string[];
set?: Record<string, (...)[]>;
};
response?: {
add?: Record<string, (...)[]>;
deferred?: boolean;
delete?: string[];
set?: Record<string, (...)[]>;
};
},
{
handler: "headers";
request?: {
add?: Record<string, (...)[]>;
delete?: string[];
set?: Record<string, (...)[]>;
};
response?: {
add?: Record<string, (...)[]>;
deferred?: boolean;
delete?: string[];
set?: Record<string, (...)[]>;
};
},
>,
ZodObject<
{
abort: ZodOptional<ZodBoolean>;
body: ZodOptional<ZodString>;
close: ZodOptional<ZodBoolean>;
handler: ZodLiteral<"static_response">;
headers: ZodOptional<
ZodRecord<ZodString, ZodArray<ZodString, "many">>,
>;
status_code: ZodOptional<ZodUnion<[ZodNumber, ZodString]>>;
},
"strip",
ZodTypeAny,
{
abort?: boolean;
body?: string;
close?: boolean;
handler: "static_response";
headers?: Record<string, string[]>;
status_code?: string | number;
},
{
abort?: boolean;
body?: string;
close?: boolean;
handler: "static_response";
headers?: Record<string, string[]>;
status_code?: string | number;
},
>,
],
>,
ZodType<
{ handler: string; [key: string]: unknown },
ZodTypeDef,
{ handler: string; [key: string]: unknown },
>,
],
> = ...
Combined handler schema - validates known handlers strictly, allows unknown handlers through for extensibility