Skip to content

Commit e3a60b9

Browse files
committed
feat: remove influxdb-iox-client-go dependency
The github.com/influxdata/influxdb-iox-client-go module has been archived and is no longer receiving any updates. Flux depended on this simply for a simple enum-style type import. The ColumnType type in question has been copied into the flux code, removing the need for the dependency.
1 parent 0ffba55 commit e3a60b9

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

dependencies/iox/client.go

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/influxdata/flux/dependencies/influxdb"
99
"github.com/influxdata/flux/internal/errors"
1010
"github.com/influxdata/flux/memory"
11-
influxdbiox "github.com/influxdata/influxdb-iox-client-go"
1211
)
1312

1413
type key int
@@ -42,6 +41,49 @@ func GetProvider(ctx context.Context) Provider {
4241
return p.(Provider)
4342
}
4443

44+
// ColumnType defines the column data types IOx can represent.
45+
type ColumnType int32
46+
47+
const (
48+
// ColumnTypeUnknown is an invalid column type.
49+
ColumnTypeUnknown ColumnType = 0
50+
// ColumnType_I64 is an int64.
51+
ColumnType_I64 ColumnType = 1
52+
// ColumnType_U64 is an uint64.
53+
ColumnType_U64 ColumnType = 2
54+
// ColumnType_F64 is an float64.
55+
ColumnType_F64 ColumnType = 3
56+
// ColumnType_BOOL is a bool.
57+
ColumnType_BOOL ColumnType = 4
58+
// ColumnType_STRING is a string.
59+
ColumnType_STRING ColumnType = 5
60+
// ColumnType_TIME is a timestamp.
61+
ColumnType_TIME ColumnType = 6
62+
// ColumnType_TAG is a tag value.
63+
ColumnType_TAG ColumnType = 7
64+
)
65+
66+
func (c ColumnType) String() string {
67+
switch c {
68+
case ColumnType_I64:
69+
return "int64"
70+
case ColumnType_U64:
71+
return "uint64"
72+
case ColumnType_F64:
73+
return "float64"
74+
case ColumnType_BOOL:
75+
return "bool"
76+
case ColumnType_STRING:
77+
return "string"
78+
case ColumnType_TIME:
79+
return "timestamp"
80+
case ColumnType_TAG:
81+
return "tag"
82+
default:
83+
return "unknown"
84+
}
85+
}
86+
4587
// RecordReader is similar to the RecordReader interface provided by Arrow's array
4688
// package, but includes a method for detecting errors that are sent mid-stream.
4789
type RecordReader interface {
@@ -58,7 +100,7 @@ type Client interface {
58100
// GetSchema will retrieve a schema for the given table if this client supports that capability.
59101
// If this Client doesn't support this capability, it should return a flux error with the code
60102
// codes.Unimplemented.
61-
GetSchema(ctx context.Context, table string) (map[string]influxdbiox.ColumnType, error)
103+
GetSchema(ctx context.Context, table string) (map[string]ColumnType, error)
62104
}
63105

64106
// ErrorProvider is an implementation of the Provider that returns an error.

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ require (
6363
gopkg.in/yaml.v3 v3.0.1 // indirect
6464
)
6565

66-
require github.com/influxdata/influxdb-iox-client-go v1.0.0-beta.1
67-
6866
require (
6967
cloud.google.com/go/auth v0.5.1 // indirect
7068
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,6 @@ github.com/influxdata/gosnowflake v1.9.0 h1:fw6peFfTfJK+jbI98RzEEbte8F1SNBX8a91c
411411
github.com/influxdata/gosnowflake v1.9.0/go.mod h1:VYPoQhZtz3I1zh+YIMG4axm/iUxoKCTbTEQl/SYvUNM=
412412
github.com/influxdata/influxdb-client-go/v2 v2.3.1-0.20210518120617-5d1fff431040 h1:MBLCfcSsUyFPDJp6T7EoHp/Ph3Jkrm4EuUKLD2rUWHg=
413413
github.com/influxdata/influxdb-client-go/v2 v2.3.1-0.20210518120617-5d1fff431040/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8=
414-
github.com/influxdata/influxdb-iox-client-go v1.0.0-beta.1 h1:zDmAiE2o3Y/YZinI6CENzgQueJDuibUB9TWOZC5zCq0=
415-
github.com/influxdata/influxdb-iox-client-go v1.0.0-beta.1/go.mod h1:Chl4pz0SRqoPmEavex4vZaQlunqXqrtEPWAN54THFfo=
416414
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
417415
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
418416
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=

0 commit comments

Comments
 (0)