2020-04-12 19:22:37 +00:00
|
|
|
package parser
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/buger/jsonparser"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ReplaceValue struct {
|
|
|
|
value []byte
|
|
|
|
valueType jsonparser.ValueType `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (cv *ReplaceValue) Value() []byte {
|
|
|
|
return cv.value
|
|
|
|
}
|
|
|
|
|
|
|
|
func (cv *ReplaceValue) String() string {
|
2020-06-30 03:08:36 +00:00
|
|
|
str, _ := jsonparser.ParseString(cv.value)
|
|
|
|
|
|
|
|
return str
|
2020-04-12 19:22:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (cv *ReplaceValue) Type() jsonparser.ValueType {
|
|
|
|
return cv.valueType
|
2020-09-05 19:08:40 +00:00
|
|
|
}
|