Add request filter for intercept

This commit is contained in:
David Stotijn
2022-03-15 19:32:29 +01:00
parent d051d48941
commit f4074a8060
18 changed files with 500 additions and 69 deletions

View File

@ -3,6 +3,7 @@ package search
import (
"encoding/gob"
"regexp"
"strconv"
"strings"
)
@ -50,13 +51,17 @@ type StringLiteral struct {
}
func (sl StringLiteral) String() string {
return sl.Value
return strconv.Quote(sl.Value)
}
type RegexpLiteral struct {
*regexp.Regexp
}
func (rl RegexpLiteral) String() string {
return strconv.Quote(rl.Regexp.String())
}
func (rl RegexpLiteral) MarshalBinary() ([]byte, error) {
return []byte(rl.Regexp.String()), nil
}