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

Function PrimitiveName

type.go:232–277  ·  view source on GitHub ↗
(typ Type)

Source from the content-addressed store, hash-verified

230}
231
232func PrimitiveName(typ Type) string {
233 switch typ.(type) {
234 case *TypeOfUint8:
235 return "uint8"
236 case *TypeOfUint16:
237 return "uint16"
238 case *TypeOfUint32:
239 return "uint32"
240 case *TypeOfUint64:
241 return "uint64"
242 case *TypeOfInt8:
243 return "int8"
244 case *TypeOfInt16:
245 return "int16"
246 case *TypeOfInt32:
247 return "int32"
248 case *TypeOfInt64:
249 return "int64"
250 case *TypeOfDuration:
251 return "duration"
252 case *TypeOfTime:
253 return "time"
254 case *TypeOfFloat16:
255 return "float16"
256 case *TypeOfFloat32:
257 return "float32"
258 case *TypeOfFloat64:
259 return "float64"
260 case *TypeOfBool:
261 return "bool"
262 case *TypeOfBytes:
263 return "bytes"
264 case *TypeOfString:
265 return "string"
266 case *TypeOfIP:
267 return "ip"
268 case *TypeOfNet:
269 return "net"
270 case *TypeOfType:
271 return "type"
272 case *TypeOfNull:
273 return "null"
274 default:
275 return fmt.Sprintf("unknown primitive type: %T", typ)
276 }
277}
278
279func LookupPrimitiveByID(id int) (Type, error) {
280 if id < 0 {

Callers 6

formatTypeValueMethod · 0.92
formatTypeMethod · 0.92
formatTypeFunction · 0.92
superTypeToZeekFunction · 0.92
newTypeMethod · 0.92
encodePrimitiveMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected