package
0.0.0-20211102154319-53df4c209bd9
Repository: https://github.com/matthewpi/cosmos.git
Documentation: pkg.go.dev

# README

All code in this package was pulled from caddy 's caddyfile package.

The commit the code was at is caddy@3903642

There has been some modifications made to this code in order to make it not require caddy as a dependency. Specifically replacer.go and replacer_test.go was pulled from Caddy's main package.

# Functions

Format formats the input Caddyfile to a standard, nice-looking appearance.
NewDispenser returns a Dispenser filled with the given tokens.
NewReplacer returns a new Replacer.
NewTestDispenser parses input into tokens and creates a new Dispenser for test purposes only; any errors are fatal.
Parse parses the input just enough to group tokens, in order, by server block.
Tokenize .

# Constants

ReplacerCtxKey is the context key for a replacer.

# Structs

Block associates any number of keys from the head of the server block with tokens, which are grouped by segments.
Dispenser is a type that dispenses tokens, similarly to a lexer, except that it can do so with some notion of structure.
Replacer can replace values in strings.
Token .

# Type aliases

No description provided by the author
ReplacementFunc is a function that is called when a replacement is being performed.
ReplacerFunc is a function that returns a replacement for the given key along with true if the function is able to service that key (even if the value is blank).
Segment is a list of tokens which begins with a directive and ends at the end of the directive (either at the end of the line, or at the end of a block it opens).