MCPcopy Create free account
hub / github.com/araddon/qlbridge / Get

Method Get

datasource/context_wrapper.go:27–46  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

25 return &ContextWrapper{reflect.ValueOf(val), &s}
26}
27func (m *ContextWrapper) Get(key string) (value.Value, bool) {
28 defer func() { recover() }()
29 keyParts := strings.Split(key, ".")
30 dot := m.val
31 var final reflect.Value
32 ident := expr.NewIdentityNodeVal(key)
33 // Now if it's a method, it gets the arguments.
34 final = m.s.evalFieldChain(dot, dot, ident, keyParts, nil, final)
35 if final == zero {
36 return nil, false
37 }
38 if m.s.err != nil {
39 return nil, false
40 }
41 val := value.NewValue(final.Interface())
42 if val == nil {
43 return nil, false
44 }
45 return val, true
46}
47func (m *ContextWrapper) Row() map[string]value.Value { return nil }
48func (m *ContextWrapper) Ts() time.Time { return time.Time{} }
49

Callers

nothing calls this directly

Calls 3

NewIdentityNodeValFunction · 0.92
NewValueFunction · 0.92
evalFieldChainMethod · 0.80

Tested by

no test coverage detected