summaryrefslogtreecommitdiff
path: root/caddyconfig
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-10-09 19:10:00 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-10-09 19:10:00 -0600
commit03306e646e3ee421f582ef69a2158724bcf2614b (patch)
treed955df462138e538916474754dbbed979b855b10 /caddyconfig
parent53dd600b4de0c2b169f1eb4450a0f02950912524 (diff)
admin: /config and /id endpoints
This integrates a feature that was previously reserved for enterprise users, according to https://github.com/caddyserver/caddy/issues/2786. The /config and /id endpoints make granular config changes possible as well as the exporting of the current configuration. The /load endpoint has been modified to wrap the /config handler so that the currently-running config can always be available for export. The difference is that /load allows configs of varying formats and converts them using config adapters. The adapted config is then processed with /config as JSON. The /config and /id endpoints accept only JSON.
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/configadapters.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/caddyconfig/configadapters.go b/caddyconfig/configadapters.go
index 1a0801f..071221f 100644
--- a/caddyconfig/configadapters.go
+++ b/caddyconfig/configadapters.go
@@ -27,10 +27,10 @@ type Adapter interface {
// Warning represents a warning or notice related to conversion.
type Warning struct {
- File string
- Line int
- Directive string
- Message string
+ File string `json:"file,omitempty"`
+ Line int `json:"line,omitempty"`
+ Directive string `json:"directive,omitempty"`
+ Message string `json:"message,omitempty"`
}
// JSON encodes val as JSON, returning it as a json.RawMessage. Any