chore: new rule

This commit is contained in:
Adlyq
2023-09-03 23:42:27 +08:00
parent 3fd954d185
commit 1f7a883bfc
8 changed files with 77 additions and 105 deletions

View File

@@ -1,7 +1,6 @@
package rewrites
import (
"errors"
regexp "github.com/dlclark/regexp2"
"strconv"
"strings"
@@ -11,7 +10,12 @@ import (
"github.com/gofrs/uuid"
)
var errInvalid = errors.New("invalid rewrite rule")
type RawMitmRule struct {
Url string `yaml:"url" json:"url"`
Action C.RewriteType `yaml:"action" json:"action"`
Old *string `yaml:"old" json:"old"`
New string `yaml:"new" json:"new"`
}
type RewriteRule struct {
id string