forked from rocketlaunchr/dataframe-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conversion.go
59 lines (49 loc) · 2.57 KB
/
conversion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2018-20 PJ Engineering and Business Solutions Pty. Ltd. All rights reserved.
package dataframe
import (
"context"
)
// ToSeriesInt64 is an interface used by the Dataframe to know if a particular
// Series can be converted to a SeriesInt64 Series.
type ToSeriesInt64 interface {
// ToSeriesInt64 is used to convert a particular Series to a SeriesInt64.
// If the returned Series is not nil but an error is still provided,
// it means that some rows were not able to be converted. You can inspect
// the error to determine which rows were unconverted.
//
// NOTE: The returned ErrorCollection should contain RowError objects.
ToSeriesInt64(context.Context, bool, ...func(interface{}) (*int64, error)) (*SeriesInt64, error)
}
// ToSeriesString is an interface used by the Dataframe to know if a particular
// Series can be converted to a SeriesString Series.
type ToSeriesString interface {
// ToSeriesString is used to convert a particular Series to a SeriesString.
// If the returned Series is not nil but an error is still provided,
// it means that some rows were not able to be converted. You can inspect
// the error to determine which rows were unconverted.
//
// NOTE: The returned ErrorCollection should contain RowError objects.
ToSeriesString(context.Context, bool, ...func(interface{}) (*string, error)) (*SeriesString, error)
}
// ToSeriesFloat64 is an interface used by the Dataframe to know if a particular
// Series can be converted to a SeriesFloat64 Series.
type ToSeriesFloat64 interface {
// ToSeriesFloat64 is used to convert a particular Series to a SeriesFloat64.
// If the returned Series is not nil but an error is still provided,
// it means that some rows were not able to be converted. You can inspect
// the error to determine which rows were unconverted.
//
// NOTE: The returned ErrorCollection should contain RowError objects.
ToSeriesFloat64(context.Context, bool, ...func(interface{}) (float64, error)) (*SeriesFloat64, error)
}
// ToSeriesMixed is an interface used by the Dataframe to know if a particular
// Series can be converted to a ToSeriesMixed Series.
type ToSeriesMixed interface {
// ToSeriesMixed is used to convert a particular Series to a ToSeriesMixed.
// If the returned Series is not nil but an error is still provided,
// it means that some rows were not able to be converted. You can inspect
// the error to determine which rows were unconverted.
//
// NOTE: The returned ErrorCollection should contain RowError objects.
ToSeriesMixed(context.Context, bool, ...func(interface{}) (interface{}, error)) (*SeriesMixed, error)
}