Package to write Caddyfile


(Ollie Phillips) #1

Hello!

Anybody know of a package/library which will write Caddyfiles. Ideally written in Golang. I foresee it marshaling struct data into a single caddyfile. The reverse of what Caddy does?

Possibly someone has already done this?


(Matt Holt) #2

The Caddyfile is loosely structured, and it’s mostly just space-separated string concatenation. You could try the ToJSON and FromJSON functions in the caddyfile package: https://godoc.org/github.com/mholt/caddy/caddyfile - otherwise I’d recommend just doing string concatenation.


(system) #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.