This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
ejs/searchGJson.go

24 lines
382 B
Go
Raw Permalink Normal View History

2024-05-11 13:28:50 +00:00
package ejs
import (
"github.com/tidwall/gjson"
)
type SearchGJsoniString struct {
JsonPath string
CompareMethode string
Value string
}
func (s SearchGJsoniString) match(data []byte) bool {
value := gjson.Get(string(data), s.JsonPath)
switch s.CompareMethode {
case "=":
if value.String() == s.Value {
return true
}
return false
}
return false
}