vcladapt

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package vcladapt is a best-effort Varnish VCL → Cadishfile converter (the `cadish adapt` command). It is explicitly a SKELETON GENERATOR, not a compiler: it maps the mechanical, high-confidence idioms (backends, pass rules, ttl/grace, hash, header edits, synthetic health responses) and emits `# TODO(adapt): …` — with the original snippet — for anything non-mechanical (ACLs, vmods, regsub, device detect, ESI, inline-C, templating), plus a mapped-vs-needs-review count.

The goal is an ~80%-there Cadishfile a human finishes, not a runnable config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	// Cadishfile is the generated skeleton.
	Cadishfile string
	// Mapped is the count of idioms confidently converted.
	Mapped int
	// TODOs is the count of constructs left for human review.
	TODOs int
}

Result is the outcome of adapting a VCL source.

func Adapt

func Adapt(filename, src string) *Result

Adapt converts VCL source into a best-effort Cadishfile skeleton. filename is used only in the generated header comment.

Jump to

Keyboard shortcuts

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