Documentation ¶
Index ¶
- Variables
- type Option
- func WithCustomDirectives(directives ...string) Option
- func WithDefaultOptions() Option
- func WithIncludeParsing() Option
- func WithSameOptions(p *Parser) Option
- func WithSkipComments() Option
- func WithSkipIncludeParsingErr() Option
- func WithSkipValidBlocks(directives ...string) Option
- func WithSkipValidDirectivesErr() Option
- type Parser
Constants ¶
This section is empty.
Variables ¶
var SkipValidBlocks map[string]struct{} = map[string]struct{}{}
SkipValidBlocks defines a list of valid blocks to be skipped during initialization. This string is split by newline characters, with each trimmed block name added to the SkipValidBlocks mapping.
var ValidDirectives map[string]string = map[string]string{}
ValidDirectives mapped directives easily find todo: this could handle the allowed blocks as well
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Parser)
Option parsing option
func WithCustomDirectives ¶
WithCustomDirectives add your custom directives as valid directives
func WithIncludeParsing ¶
func WithIncludeParsing() Option
WithIncludeParsing enable parsing included files
func WithSameOptions ¶
WithSameOptions copy options from another parser
func WithSkipIncludeParsingErr ¶
func WithSkipIncludeParsingErr() Option
WithSkipIncludeParsingErr ignores include parsing errors
func WithSkipValidBlocks ¶
WithSkipValidBlocks add your custom block as valid
func WithSkipValidDirectivesErr ¶
func WithSkipValidDirectivesErr() Option
WithSkipValidDirectivesErr ignores unknown directive errors
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is an nginx config parser
func NewParserFromLexer ¶
NewParserFromLexer initilizes a new Parser
func NewStringParser ¶
NewStringParser parses nginx conf from string
func (*Parser) ParseInclude ¶
ParseInclude just parse include confs