rweng

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Eng

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

Eng http.Request rule engine.

func NewEngFromYml

func NewEngFromYml(filename string, logger *zap.Logger) (*Eng, error)

NewEngFromYml loads an engine from yaml data

func (*Eng) ProcessRequest

func (e *Eng) ProcessRequest(w http.ResponseWriter, r *http.Request)

ProcessRequest performs any rules on matching requests

type EngCfg

type EngCfg struct {
	UrlWhiteList []string    `yaml:"urlWhiteList"`
	PostBan      []string    `yaml:"postBan"`
	UrlBan       []string    `yaml:"urlBan"`
	QueryBan     []string    `yaml:"queryBan"`
	Filter       []FilterCfg `yaml:"postFilter"`
}

EngCfg defines an engine configuration

type FilterCfg added in v1.0.7

type FilterCfg struct {
	Name     string `yaml:"name"`
	Match    string `yaml:"match"`
	Template string `yaml:"template"`
}

type FilterTemplate added in v1.0.7

type FilterTemplate struct {
	Name     string
	Match    string
	Template *template.Template
}

Jump to

Keyboard shortcuts

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