(loader *loader)
| 108 | } |
| 109 | |
| 110 | func (p *primitive) newVector(loader *loader) vector.Any { |
| 111 | switch typ := p.meta.Typ.(type) { |
| 112 | case *super.TypeOfUint8, *super.TypeOfUint16, *super.TypeOfUint32, *super.TypeOfUint64: |
| 113 | return vector.NewUint(typ, p.load(loader).([]uint64)) |
| 114 | case *super.TypeOfInt8, *super.TypeOfInt16, *super.TypeOfInt32, *super.TypeOfInt64, *super.TypeOfDuration, *super.TypeOfTime: |
| 115 | return vector.NewInt(typ, p.load(loader).([]int64)) |
| 116 | case *super.TypeOfFloat16, *super.TypeOfFloat32, *super.TypeOfFloat64: |
| 117 | return vector.NewFloat(typ, p.load(loader).([]float64)) |
| 118 | case *super.TypeOfBool: |
| 119 | return vector.NewBool(p.load(loader).(bitvec.Bits)) |
| 120 | case *super.TypeOfBytes: |
| 121 | return vector.NewBytes(p.load(loader).(vector.BytesTable)) |
| 122 | case *super.TypeOfString: |
| 123 | return vector.NewString(p.load(loader).(vector.BytesTable)) |
| 124 | case *super.TypeOfIP: |
| 125 | return vector.NewIP(p.load(loader).([]netip.Addr)) |
| 126 | case *super.TypeOfNet: |
| 127 | return vector.NewNet(p.load(loader).([]netip.Prefix)) |
| 128 | case *super.TypeOfType: |
| 129 | return vector.NewTypeValue(p.load(loader).(vector.BytesTable)) |
| 130 | case *super.TypeEnum: |
| 131 | return vector.NewEnum(typ, p.load(loader).([]uint64)) |
| 132 | case *super.TypeOfNull: |
| 133 | return vector.NewNull(p.length()) |
| 134 | } |
| 135 | panic(fmt.Errorf("internal error: vcache.loadPrimitive got unknown type %#v", p.meta.Typ)) |
| 136 | } |
no test coverage detected