parser

package
v0.0.0-...-ea924cd Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Augeas      augeas.Augeas
	LoadedPaths map[string][]string
	ServerRoot,
	ConfigListen,
	ConfigRoot string
	// contains filtered or unexported fields
}

func GetParser

func GetParser(apachectl apachectl.ApacheCtl, lensModule, serverRoot, hostRoot, hostFiles string) (*Parser, error)

func (*Parser) AddDirective

func (p *Parser) AddDirective(augConfPath string, directive string, args []string) error

AddDirective adds directive to the end of the file given by augConfPath

func (*Parser) AddDirectiveToIfModSSL

func (p *Parser) AddDirectiveToIfModSSL(augConfPath string, directive string, args []string) error

AddDirectiveToIfModSSL adds directive to the end of the file given by augConfPath within IfModule ssl block

func (*Parser) AddInclude

func (p *Parser) AddInclude(mainConfigPath string, inclPath string) error

AddInclude adds Include directive for a configuration file

func (*Parser) Close

func (p *Parser) Close()

Close closes the Parser instance and frees any storage associated with it.

func (*Parser) FindDirective

func (p *Parser) FindDirective(directive, arg, start string, exclude bool) ([]string, error)

FindDirective finds directive in configuration directive - directive to look for arg - directive value. If empty string then all directives should be considrered start - Augeas path that should be used to begin looking for the directive exclude - whether or not to exclude directives based on variables and enabled modules

func (*Parser) GetArg

func (p *Parser) GetArg(match string) (string, error)

GetArg returns argument value and interprets result

func (*Parser) IsFilenameExistInLoadedPaths

func (p *Parser) IsFilenameExistInLoadedPaths(filename string) bool

IsFilenameExistInLoadedPaths checks if the file path is parsed by current Augeas parser config

func (*Parser) IsFilenameExistInOriginalPaths

func (p *Parser) IsFilenameExistInOriginalPaths(filename string) bool

IsFilenameExistInOriginalPaths checks if the file path is parsed by existing Apache config

func (*Parser) ModuleExists

func (p *Parser) ModuleExists(name string) bool

func (*Parser) ParseFile

func (p *Parser) ParseFile(fPath string) error

func (*Parser) ResetModules

func (p *Parser) ResetModules() error

ResetModules resets the loaded modules list

func (*Parser) Save

func (p *Parser) Save(reverter reverter.Reverter) error

func (*Parser) UpdateRuntimeVariables

func (p *Parser) UpdateRuntimeVariables() error

UpdateRuntimeVariables Updates Includes, Defines and Modules from httpd config dump data

Jump to

Keyboard shortcuts

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