NewNestedContextReader provides a context reader which prefixes all keys with a name space. This is useful if you have overlapping field names between ContextReaders within a NestedContextReader. msg.Get("foo.key")
(basereader expr.ContextReader, namespace string)
| 277 | // msg.Get("foo.key") |
| 278 | // |
| 279 | func NewNamespacedContextReader(basereader expr.ContextReader, namespace string) expr.ContextReader { |
| 280 | if namespace == "" { |
| 281 | return basereader |
| 282 | } |
| 283 | return &NamespacedContextReader{basereader, strings.ToLower(namespace)} |
| 284 | } |
| 285 | |
| 286 | func (n *NamespacedContextReader) Get(key string) (value.Value, bool) { |
| 287 | left, right, has := expr.LeftRight(key) |
no outgoing calls