nginx

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Debug = iota
	Info
	Notice
	Warn
	Error
	Crit
	Alert
	Emerg
)
View Source
const (
	Server   = "server"
	Location = "location"
	Upstream = "upstream"
)

Variables

This section is empty.

Functions

func FmtCode added in v1.7.0

func FmtCode(content string) (fmtContent string)

func GetConfPath added in v1.7.2

func GetConfPath(dir ...string) string

func GetLogLevel added in v1.7.4

func GetLogLevel(output string) int

func GetNginxPIDPath added in v1.7.6

func GetNginxPIDPath() string

func Reload added in v1.7.2

func Reload() string

func Restart added in v1.7.6

func Restart() string

func TestConf added in v1.7.2

func TestConf() string

Types

type NgxConfig

type NgxConfig struct {
	FileName  string         `json:"file_name"`
	Name      string         `json:"name"`
	Upstreams []*NgxUpstream `json:"upstreams"`
	Servers   []*NgxServer   `json:"servers"`
	Custom    string         `json:"custom"`
	// contains filtered or unexported fields
}

func NewNgxConfig

func NewNgxConfig(filename string) *NgxConfig

func ParseNgxConfig

func ParseNgxConfig(filename string) (ngxConfig *NgxConfig, err error)

func ParseNgxConfigByContent added in v1.7.0

func ParseNgxConfigByContent(content string) (ngxConfig *NgxConfig)

func (*NgxConfig) BuildConfig

func (c *NgxConfig) BuildConfig() (content string)

func (*NgxConfig) FmtCode added in v1.7.0

func (c *NgxConfig) FmtCode() (fmtContent string)

type NgxDirective

type NgxDirective struct {
	Directive string `json:"directive"`
	Params    string `json:"params"`
	Comments  string `json:"comments"`
}

func (*NgxDirective) Orig

func (d *NgxDirective) Orig() string

func (*NgxDirective) ParseDirective added in v1.7.0

func (d *NgxDirective) ParseDirective(directive gonginx.IDirective, deep int)

func (*NgxDirective) TrimParams

func (d *NgxDirective) TrimParams()

type NgxLocation

type NgxLocation struct {
	Path     string `json:"path"`
	Content  string `json:"content"`
	Comments string `json:"comments"`
}

func (*NgxLocation) ParseLocation added in v1.7.0

func (l *NgxLocation) ParseLocation(directive gonginx.IDirective, deep int)

type NgxServer

type NgxServer struct {
	Directives []*NgxDirective `json:"directives"`
	Locations  []*NgxLocation  `json:"locations"`
	Comments   string          `json:"comments"`
}

func NewNgxServer

func NewNgxServer() *NgxServer

func (*NgxServer) ParseServer added in v1.7.0

func (s *NgxServer) ParseServer(directive gonginx.IDirective)

type NgxUpstream

type NgxUpstream struct {
	Name       string          `json:"name"`
	Directives []*NgxDirective `json:"directives"`
	Comments   string          `json:"comments"`
}

Jump to

Keyboard shortcuts

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