()
| 409 | } |
| 410 | |
| 411 | func (v *Value) AsInt() int64 { |
| 412 | if v != nil { |
| 413 | switch TypeUnder(v.Type()).(type) { |
| 414 | case *TypeOfUint8, *TypeOfUint16, *TypeOfUint32, *TypeOfUint64: |
| 415 | return int64(v.Uint()) |
| 416 | case *TypeOfInt8, *TypeOfInt16, *TypeOfInt32, *TypeOfInt64: |
| 417 | return v.Int() |
| 418 | } |
| 419 | } |
| 420 | return 0 |
| 421 | } |
| 422 | |
| 423 | func (v *Value) AsTime() nano.Ts { |
| 424 | if v != nil && TypeUnder(v.Type()) == TypeTime { |