nginx

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 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

func FmtCode(content string) (fmtContent string)

func GetConfPath

func GetConfPath(dir ...string) string

func GetLogLevel

func GetLogLevel(output string) int

func GetNginxPIDPath

func GetNginxPIDPath() string

func Reload

func Reload() string

func Restart

func Restart() string

func TestConf

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

func ParseNgxConfigByContent(content string) (ngxConfig *NgxConfig)

func (*NgxConfig) BuildConfig

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

func (*NgxConfig) FmtCode

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

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

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

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