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

Method encodeTypeMap

sio/bsupio/types.go:171–185  ·  view source on GitHub ↗
(ext *super.TypeMap)

Source from the content-addressed store, hash-verified

169}
170
171func (e *Encoder) encodeTypeMap(ext *super.TypeMap) (*super.TypeMap, error) {
172 keyType, err := e.Encode(ext.KeyType)
173 if err != nil {
174 return nil, err
175 }
176 valType, err := e.Encode(ext.ValType)
177 if err != nil {
178 return nil, err
179 }
180 typ := e.sctx.LookupTypeMap(keyType, valType)
181 e.bytes = append(e.bytes, TypeDefMap)
182 e.bytes = binary.AppendUvarint(e.bytes, uint64(super.TypeID(keyType)))
183 e.bytes = binary.AppendUvarint(e.bytes, uint64(super.TypeID(valType)))
184 return typ, nil
185}
186
187func (e *Encoder) encodeTypeName(ext *super.TypeNamed) (*super.TypeNamed, error) {
188 inner, err := e.Encode(ext.Type)

Callers 1

encodeMethod · 0.95

Implementers 10

FusionEncodercsup/fusion.go
RecordEncodercsup/record.go
FloatEncodercsup/float.go
IntEncodercsup/int.go
UintEncodercsup/int.go
UnionEncodercsup/union.go
ArrayEncodercsup/array.go
ScodeEncodercsup/scode.go
MapEncodercsup/map.go
BytesEncodercsup/bytes.go

Calls 3

EncodeMethod · 0.95
TypeIDFunction · 0.92
LookupTypeMapMethod · 0.80

Tested by

no test coverage detected