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

Function NewPrimitiveEncoder

csup/encoder.go:67–80  ·  view source on GitHub ↗
(typ super.Type)

Source from the content-addressed store, hash-verified

65}
66
67func NewPrimitiveEncoder(typ super.Type) PrimitiveEncoder {
68 switch id := typ.ID(); {
69 case super.IsSigned(id):
70 return NewIntEncoder(typ)
71 case super.IsUnsigned(id):
72 return NewUintEncoder(typ)
73 case super.IsFloat(id):
74 return NewFloatEncoder(typ)
75 case id == super.IDBytes || id == super.IDString || id == super.IDType:
76 return NewBytesEncoder(typ)
77 default:
78 return NewScodeEncoder(typ)
79 }
80}
81
82type NamedEncoder struct {
83 Encoder

Callers 1

NewEncoderFunction · 0.85

Calls 9

IsSignedFunction · 0.92
IsUnsignedFunction · 0.92
IsFloatFunction · 0.92
NewIntEncoderFunction · 0.85
NewUintEncoderFunction · 0.85
NewFloatEncoderFunction · 0.85
NewBytesEncoderFunction · 0.85
NewScodeEncoderFunction · 0.85
IDMethod · 0.65

Tested by

no test coverage detected