nginx

package
v0.0.0-...-d8a4e70 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: AGPL-3.0 Imports: 7 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 {
	// contains filtered or unexported fields
}

Parser Nginx vhost 配置解析器

func NewParser

func NewParser(str ...string) (*Parser, error)

func (*Parser) Clear

func (p *Parser) Clear(key string) error

Clear 通过表达式移除配置 e.g. Clear("server.server_name")

func (*Parser) ClearSetHTTPS

func (p *Parser) ClearSetHTTPS() error

func (*Parser) Config

func (p *Parser) Config() *config.Config

func (*Parser) Dump

func (p *Parser) Dump() string

func (*Parser) Find

func (p *Parser) Find(key string) ([]config.IDirective, error)

Find 通过表达式查找配置 e.g. Find("server.listen")

func (*Parser) FindOne

func (p *Parser) FindOne(key string) (config.IDirective, error)

FindOne 通过表达式查找一个配置 e.g. FindOne("server.server_name")

func (*Parser) GetAccessLog

func (p *Parser) GetAccessLog() (string, error)

func (*Parser) GetAltSvc

func (p *Parser) GetAltSvc() string

func (*Parser) GetErrorLog

func (p *Parser) GetErrorLog() (string, error)

func (*Parser) GetHSTS

func (p *Parser) GetHSTS() bool

func (*Parser) GetHTTPS

func (p *Parser) GetHTTPS() bool

func (*Parser) GetHTTPSCiphers

func (p *Parser) GetHTTPSCiphers() string

func (*Parser) GetHTTPSProtocols

func (p *Parser) GetHTTPSProtocols() []string

func (*Parser) GetHTTPSRedirect

func (p *Parser) GetHTTPSRedirect() bool

func (*Parser) GetIncludes

func (p *Parser) GetIncludes() (includes []string, comments [][]string, err error)

func (*Parser) GetIndex

func (p *Parser) GetIndex() ([]string, error)

func (*Parser) GetIndexWithComment

func (p *Parser) GetIndexWithComment() ([]string, []string, error)

func (*Parser) GetListen

func (p *Parser) GetListen() ([][]string, error)

func (*Parser) GetOCSP

func (p *Parser) GetOCSP() bool

func (*Parser) GetPHP

func (p *Parser) GetPHP() int

func (*Parser) GetRoot

func (p *Parser) GetRoot() (string, error)

func (*Parser) GetRootWithComment

func (p *Parser) GetRootWithComment() (string, []string, error)

func (*Parser) GetServerName

func (p *Parser) GetServerName() ([]string, error)

func (*Parser) Set

func (p *Parser) Set(key string, directives []*config.Directive) error

Set 通过表达式设置配置 e.g. Set("server.server_name", []directive)

func (*Parser) SetAccessLog

func (p *Parser) SetAccessLog(accessLog string) error

func (*Parser) SetAltSvc

func (p *Parser) SetAltSvc(altSvc string) error

func (*Parser) SetErrorLog

func (p *Parser) SetErrorLog(errorLog string) error

func (*Parser) SetHSTS

func (p *Parser) SetHSTS(hsts bool) error

func (*Parser) SetHTTPRedirect

func (p *Parser) SetHTTPRedirect(httpRedirect bool) error

func (*Parser) SetHTTPS

func (p *Parser) SetHTTPS(cert, key string) error

func (*Parser) SetHTTPSCiphers

func (p *Parser) SetHTTPSCiphers(ciphers string) error

func (*Parser) SetHTTPSProtocols

func (p *Parser) SetHTTPSProtocols(protocols []string) error

func (*Parser) SetIncludes

func (p *Parser) SetIncludes(includes []string, comments [][]string) error

func (*Parser) SetIndex

func (p *Parser) SetIndex(index []string) error

func (*Parser) SetIndexWithComment

func (p *Parser) SetIndexWithComment(index []string, comment []string) error

func (*Parser) SetListen

func (p *Parser) SetListen(listen [][]string) error

func (*Parser) SetOCSP

func (p *Parser) SetOCSP(ocsp bool) error

func (*Parser) SetPHP

func (p *Parser) SetPHP(php int) error

func (*Parser) SetRoot

func (p *Parser) SetRoot(root string) error

func (*Parser) SetRootWithComment

func (p *Parser) SetRootWithComment(root string, comment []string) error

func (*Parser) SetServerName

func (p *Parser) SetServerName(serverName []string) error

func (*Parser) Sort

func (p *Parser) Sort()

Jump to

Keyboard shortcuts

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