Add intercept module

This commit is contained in:
David Stotijn
2022-03-23 14:31:27 +01:00
parent 6ffc55cde3
commit 02408b5196
51 changed files with 5779 additions and 304 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
}