MCPcopy Create free account
hub / github.com/brimdata/super / LookupTypeValue

Method LookupTypeValue

context.go:403–419  ·  view source on GitHub ↗
(typ Type)

Source from the content-addressed store, hash-verified

401}
402
403func (c *Context) LookupTypeValue(typ Type) Value {
404 c.mu.Lock()
405 if c.toValue != nil {
406 if bytes, ok := c.toValue[typ]; ok {
407 c.mu.Unlock()
408 return NewValue(TypeType, bytes)
409 }
410 }
411 c.mu.Unlock()
412 tv := EncodeTypeValue(typ)
413 typ, err := c.LookupByValue(tv)
414 if err != nil {
415 // This shouldn't happen.
416 return c.Missing()
417 }
418 return c.LookupTypeValue(typ)
419}
420
421func (c *Context) DecodeTypeValue(tv scode.Bytes) (Type, scode.Bytes) {
422 if len(tv) == 0 {

Callers 15

TestTypeValueFunction · 0.95
SerializeMethod · 0.80
convertFusionMethod · 0.80
encodeAnyMethod · 0.80
CallMethod · 0.80
CallMethod · 0.80
CallMethod · 0.80
ResultMethod · 0.80
evalTypeOfTypeMethod · 0.80
CallMethod · 0.80
CallMethod · 0.80

Calls 4

LookupByValueMethod · 0.95
MissingMethod · 0.95
NewValueFunction · 0.85
EncodeTypeValueFunction · 0.85

Tested by 2

TestTypeValueFunction · 0.76