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

Function LookupPrimitive

type.go:186–230  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

184}
185
186func LookupPrimitive(name string) Type {
187 switch name {
188 case "uint8":
189 return TypeUint8
190 case "uint16":
191 return TypeUint16
192 case "uint32":
193 return TypeUint32
194 case "uint64":
195 return TypeUint64
196 case "int8":
197 return TypeInt8
198 case "int16":
199 return TypeInt16
200 case "int32":
201 return TypeInt32
202 case "int64":
203 return TypeInt64
204 case "duration":
205 return TypeDuration
206 case "time":
207 return TypeTime
208 case "float16":
209 return TypeFloat16
210 case "float32":
211 return TypeFloat32
212 case "float64":
213 return TypeFloat64
214 case "bool":
215 return TypeBool
216 case "bytes":
217 return TypeBytes
218 case "string":
219 return TypeString
220 case "ip":
221 return TypeIP
222 case "net":
223 return TypeNet
224 case "type":
225 return TypeType
226 case "null":
227 return TypeNull
228 }
229 return nil
230}
231
232func PrimitiveName(typ Type) string {
233 switch typ.(type) {

Callers 7

convertPrimitiveMethod · 0.92
convertTypeMethod · 0.92
matchTypeNameMethod · 0.92
ParsePrimitiveFunction · 0.92
TestArithmeticFunction · 0.92
decodeTypeMethod · 0.92
LookupTypeNamedMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestArithmeticFunction · 0.74