nginxconf

package
v0.0.0-...-e1804a1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EOF tokenType = iota

	Word
	Comment
)

Variables

View Source
var (
	EOFToken        = Token{Typ: EOF}
	BraceOpenToken  = Token{Typ: braceOpen, Lit: "{"}
	BraceCloseToken = Token{Typ: braceClose, Lit: "}"}
	SemicolonToken  = Token{Typ: semicolon, Lit: ";"}
)
View Source
var ErrSyntax = errors.New("syntax error")

Functions

This section is empty.

Types

type NginxConfigureBlock

type NginxConfigureBlock []NginxConfigureCommand

NginxConfigureBlock represent a block in nginx configure file. The content of a nginx configure file should be a block.

func Parse

func Parse(content []byte) (blk NginxConfigureBlock, err error)

Parse the content of nginx configure file into NginxConfigureBlock.

func (NginxConfigureBlock) ParseServers

func (conf NginxConfigureBlock) ParseServers() []NginxServer

type NginxConfigureCommand

type NginxConfigureCommand struct {
	// Words compose the command
	Words []string

	// Block follow the command
	Block NginxConfigureBlock
}

NginxConfigureCommand represenct a command in nginx configure file.

type NginxServer

type NginxServer struct {
	ListenPort int
	Locations  directive.Locations
	ServerName string
}

func (NginxServer) ServeHTTP

func (s NginxServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RunningServers

type RunningServers struct {
	Servers map[int]*container
}

func NewRunningServers

func NewRunningServers() *RunningServers

func (*RunningServers) Register

func (s *RunningServers) Register(server NginxServer)

func (*RunningServers) Start

func (s *RunningServers) Start()

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(content []byte) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan() Token

type Token

type Token struct {
	Typ tokenType
	Lit string
}

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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