analysis

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownGlobalOptions = map[string]bool{
	"debug":              true,
	"http_port":          true,
	"https_port":         true,
	"default_bind":       true,
	"grace_period":       true,
	"shutdown_delay":     true,
	"admin":              true,
	"on_demand_tls":      true,
	"storage":            true,
	"acme_ca":            true,
	"acme_ca_root":       true,
	"acme_dns":           true,
	"acme_eab":           true,
	"cert_issuer":        true,
	"skip_install_trust": true,
	"email":              true,
	"ocsp_stapling":      true,
	"ocsp_interval":      true,
	"preferred_chains":   true,
	"key_type":           true,
	"auto_https":         true,
	"metrics":            true,
	"tracing":            true,
	"servers":            true,
	"log":                true,
	"order":              true,
	"local_certs":        true,
	"persist_config":     true,
	"pki":                true,
	"import":             true,
}

KnownGlobalOptions is the set of directives valid inside the global options block. Source: https://caddyserver.com/docs/caddyfile/options

View Source
var KnownTopLevel = map[string]bool{

	"abort":         true,
	"error":         true,
	"handle":        true,
	"handle_errors": true,
	"handle_path":   true,
	"invoke":        true,
	"map":           true,
	"method":        true,
	"redir":         true,
	"request_body":  true,
	"respond":       true,
	"rewrite":       true,
	"route":         true,
	"try_files":     true,
	"uri":           true,
	"vars":          true,

	"forward_auth":  true,
	"php_fastcgi":   true,
	"reverse_proxy": true,

	"file_server": true,
	"push":        true,
	"root":        true,

	"acme_server": true,
	"tls":         true,

	"header":         true,
	"request_header": true,

	"encode":    true,
	"templates": true,

	"basic_auth": true,
	"basicauth":  true,

	"log":        true,
	"log_append": true,
	"log_skip":   true,
	"log_name":   true,

	"intercept": true,
	"metrics":   true,
	"tracing":   true,

	"bind":        true,
	"import":      true,
	"local_certs": true,
}

KnownTopLevel is the set of directives valid at the site-block level. Source: https://caddyserver.com/docs/caddyfile/directives

Functions

func Analyze

func Analyze(f *parser.File) []protocol.Diagnostic

Analyze walks the AST and returns diagnostics.

func CollectSnippetNames

func CollectSnippetNames(f *parser.File) []string

CollectSnippetNames returns the names of all snippets defined in f, without the surrounding parentheses, sorted alphabetically. The completion handler uses this to suggest snippet names after "import".

func SubDirectivesFor

func SubDirectivesFor(parentName string) (subs map[string]bool, ok bool)

SubDirectivesFor returns the set of valid subdirective names for parentName. ok is false when the parent is unknown to the analyzer; the returned map is nil when the body is freeform (no sub-directive validation applies).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL