Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RegPortValue = regexp.MustCompile(`^listen\s*(\d+)\s*\S*$`) RegServerNameValue = regexp.MustCompile(`^server_name\s*(.+)$`) )
Functions ¶
func StreamServers ¶
Types ¶
type ConfigManager ¶
type ConfigManager interface { Start() error Stop() error GetConfiguration() Configuration GetServerInfo() *v1.WebServerInfo // contains filtered or unexported methods }
func NewNginxConfigurationManager ¶
func NewNginxConfigurationManager( loader loader.Loader, configuration Configuration, serverBinPath, backupDir string, backupCycle, backupSaveTime int, rwLocker *sync.RWMutex, ) ConfigManager
type Configuration ¶
type Configuration interface { Querier // insert InsertByKeyword(insertParser parser.Parser, keyword string) error InsertByQueryer(insertParser parser.Parser, queryer Querier) error // InsertByIndex(insertParser parser.Parser, targetContext parser.Context, index int) error // remove RemoveByKeyword(keyword string) error RemoveByQueryer(queryer Querier) error // RemoveByIndex(targetContext parser.Context, index int) error // modify ModifyByKeyword(modifyParser parser.Parser, keyword string) error ModifyByQueryer(modifyParser parser.Parser, queryer Querier) error // ModifyByIndex(modifyParser parser.Parser, targetContext parser.Context, index int) error // update all UpdateFromJsonBytes(data []byte) error // view View() []byte Json() []byte Dump() map[string][]byte // contains filtered or unexported methods }
keyword string: <parser type>[':sep: <value string>', ':sep: :reg: <value regexp>']
e.g. for Nginx Config keyword string:
- server
- location:sep: :reg: \^\~\s+\/
- key:sep: server_name test1\.com
- comment:sep: :reg: .*
func NewConfiguration ¶
func NewConfiguration( config *parser.Config, preventer loop_preventer.LoopPreventer, rwLocker *sync.RWMutex, ) Configuration
func NewConfigurationFromJsonBytes ¶
func NewConfigurationFromJsonBytes(data []byte) (Configuration, error)
func NewConfigurationFromPath ¶
func NewConfigurationFromPath(filePath string) (Configuration, error)
type Querier ¶
type Querier interface { // keyword string: <parser type>[':sep: <value string>', ':sep: :reg: <value regexp>'] // // e.g. for Nginx Config keyword string: // 1) server // 2) location:sep: :reg: \^\~\s+\/ // 3) key:sep: server_name test1\.com // 4) comment:sep: :reg: .* Query(keyword string) (Querier, error) // keyword string: <parser type>[':sep: <value string>', ':sep: :reg: <value regexp>'] // // e.g. for Nginx Config keyword string: // 1) server // 2) location:sep: :reg: \^\~\s+\/ // 3) key:sep: server_name test1\.com // 4) comment:sep: :reg: .* QueryAll(keyword string) ([]Querier, error) Self() parser.Parser // contains filtered or unexported methods }
keyword string: <parser type>[':sep: <value string>', ':sep: :reg: <value regexp>']
e.g. for Nginx Config keyword string:
- server
- location:sep: :reg: \^\~\s+\/
- key:sep: server_name test1\.com
- comment:sep: :reg: .*
type Statistician ¶
type Statistician interface { HttpInfo() HttpInfo StreamInfo() StreamInfo Statistics() *v1.Statistics }
func NewStatistician ¶
func NewStatistician(c Configuration) Statistician
type StreamInfo ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.