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

Method Encode

sio/bsupio/types.go:54–64  ·  view source on GitHub ↗

Encode takes a type from outside this context and constructs a type from inside this context and emits BSUP typedefs for any type needed to construct the new type into the buffer provided.

(external super.Type)

Source from the content-addressed store, hash-verified

52// inside this context and emits BSUP typedefs for any type needed to construct
53// the new type into the buffer provided.
54func (e *Encoder) Encode(external super.Type) (super.Type, error) {
55 if typ, ok := e.encoded[external]; ok {
56 return typ, nil
57 }
58 internal, err := e.encode(external)
59 if err != nil {
60 return nil, err
61 }
62 e.encoded[external] = internal
63 return internal, err
64}
65
66func (e *Encoder) encode(ext super.Type) (super.Type, error) {
67 switch ext := ext.(type) {

Callers 8

encodeTypeRecordMethod · 0.95
encodeTypeUnionMethod · 0.95
encodeTypeSetMethod · 0.95
encodeTypeArrayMethod · 0.95
encodeTypeMapMethod · 0.95
encodeTypeNameMethod · 0.95
encodeTypeErrorMethod · 0.95
encodeTypeFusionMethod · 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 1

encodeMethod · 0.95

Tested by

no test coverage detected