Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrKvViewValueIsNotAString = errors.New("value is not a string") ErrKvViewEntryNotFound = errors.New("entry not found") )
var (
ErrMalformedData = errors.New("malformed data")
)
Functions ¶
func JsonValidator ¶
JsonValidator returns nil if input is valid json and ErrMalformedData otherwise.
Types ¶
type FasthttpArgsKeysValuesCollector ¶
type FasthttpArgsKeysValuesCollector struct { Args *fasthttp.Args Prefix string ValueValidator func([]byte) error }
FasthttpArgsKeysValuesCollector implements KvCollector. FasthttpArgsKeysValuesCollector collects values whose key have given prefix as raw string.
func (FasthttpArgsKeysValuesCollector) CollectKeysValues ¶
func (fakvc FasthttpArgsKeysValuesCollector) CollectKeysValues() (keys, values []string, err error)
CollectKeysValues implements keysValuesCollector.
type FasthttpArgsKvView ¶
FasthttpArgsKvView is KvView implementation based on *fasthttp.Args.
type JsonData ¶
type JsonData struct {
// contains filtered or unexported fields
}
JsonData define data that is potentially encoded as JSON value.
func NewJsonData ¶
NewJsonData creates a new JsonData holding given untrusted inner data.
type JsonKvCollector ¶
JsonKvCollector collects keys and values from a JSON object. Values are raw JSON encoded value: string values will contains quotes.
func (JsonKvCollector) CollectKeysValues ¶
func (jkc JsonKvCollector) CollectKeysValues() (keys, values []string, err error)
CollectKeysValues implements KvCollector. JsonKvCollector collects values as raw JSON encoded string: string value will contains quotes.
type JsonKvView ¶
type JsonKvView struct {
Json *JsonData
}
JsonKvView is a KvView implementation over a JSON object.
type KvCollector ¶
KvCollector define objects that can collect a set of keys and values.