nginx

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Server       = "server"
	Location     = "location"
	Upstream     = "upstream"
	CommentStart = "#"
	Empty        = ""
	If           = "if"
)

Variables

This section is empty.

Functions

func GetNginxConfPath

func GetNginxConfPath(dir string) string

func ReloadNginx

func ReloadNginx() string

func TestNginxConf

func TestNginxConf() error

Types

type CommentQueue

type CommentQueue struct {
	*linkedlistqueue.Queue
}

func (*CommentQueue) DequeueAllComments

func (c *CommentQueue) DequeueAllComments() (comments string)

type NgxConfig

type NgxConfig struct {
	FileName  string         `json:"file_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) (c *NgxConfig, err error)

func ParseNgxConfigByScanner

func ParseNgxConfigByScanner(filename string, scanner *bufio.Scanner) (c *NgxConfig, err error)

func (*NgxConfig) BuildConfig

func (c *NgxConfig) BuildConfig() (content 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) TrimParams

func (d *NgxDirective) TrimParams()

type NgxLocation

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

type NgxServer

type NgxServer struct {
	Directives []*NgxDirective `json:"directives"`
	Locations  []*NgxLocation  `json:"locations"`
	Comments   string          `json:"comments"`
	// contains filtered or unexported fields
}

func NewNgxServer

func NewNgxServer() *NgxServer

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