Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/naming conventions #156

Merged
merged 3 commits into from
Jul 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: ignoring known problems, fixing few remaining and allowing run…
…ning full suite check
vlastahajek committed Jul 17, 2020
commit e8aa4ff3be321ffcc7712b04b5604e14a4ab97ec
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ jobs:
# fi
- run: go get -v -t -d ./...
- run: go vet ./...
- run: go get honnef.co/go/tools/cmd/staticcheck && staticcheck --checks="inherit,-SA1019" ./...
- run: go get honnef.co/go/tools/cmd/staticcheck && staticcheck --checks="all" --tags e2e ./...
- run:
name: "Create a temp directory for artifacts"
command: |
3 changes: 3 additions & 0 deletions api/authorizations_deprecated.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ import (
"github.com/influxdata/influxdb-client-go/domain"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release

// AuthorizationsApi provides methods for organizing Authorization in a InfluxDB server
// Deprecated: Use AuthorizationsAPI instead
type AuthorizationsApi interface {
@@ -36,6 +38,7 @@ type authorizationsApiImpl struct {
authorizationsAPI AuthorizationsAPI
}

// NewAuthorizationsApi creates instance of AuthorizationsApi
// Deprecated: Use NewAuthorizationsAPI instead.
func NewAuthorizationsApi(apiClient *domain.ClientWithResponses) AuthorizationsApi {
return &authorizationsApiImpl{
3 changes: 3 additions & 0 deletions api/buckets_deprecated.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ import (
"github.com/influxdata/influxdb-client-go/domain"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release.

// BucketsApi provides methods for managing Buckets in a InfluxDB server.
// Deprecated: Use BucketsAPI instead.
type BucketsApi interface {
@@ -64,6 +66,7 @@ type bucketsApiImpl struct {
bucketsAPI BucketsAPI
}

// NewBucketsApi creates instance of BucketsApi
// Deprecated: Use NewBucketsAPI instead
func NewBucketsApi(apiClient *domain.ClientWithResponses) BucketsApi {
return &bucketsApiImpl{
3 changes: 3 additions & 0 deletions api/delete_deprecated.go
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ import (
"time"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release.

// DeleteApi provides methods for deleting time series data from buckets.
// Deleted series are selected by the time range specified by start and stop arguments and optional predicate string which contains condition for selecting data for deletion, such as:
// tag1="value1" and (tag2="value2" and tag3!="value3"). Empty predicate string means all data from the given time range will be deleted. See https://v2.docs.influxdata.com/v2.0/reference/syntax/delete-predicate/
@@ -28,6 +30,7 @@ type deleteApiImpl struct {
deleteAPI DeleteAPI
}

// NewDeleteApi creates instance of DeleteApi
// Deprecated: Use NewDeleteAPI instead
func NewDeleteApi(apiClient *domain.ClientWithResponses) DeleteApi {
return &deleteApiImpl{
4 changes: 4 additions & 0 deletions api/http/options.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ func (o *Options) TLSConfig() *tls.Config {

// TlsConfig returns TlsConfig
// Deprecated: Use TLSConfig instead.
//lint:ignore ST1003 Deprecated method to be removed in the next release
func (o *Options) TlsConfig() *tls.Config {
return o.TLSConfig()
}
@@ -36,6 +37,7 @@ func (o *Options) SetTLSConfig(tlsConfig *tls.Config) *Options {

// SetTlsConfig sets TLS configuration for secure connection
// Deprecated: Use SetTLSConfig instead.
//lint:ignore ST1003 Deprecated method to be removed in the next release
func (o *Options) SetTlsConfig(tlsConfig *tls.Config) *Options {
return o.SetTLSConfig(tlsConfig)
}
@@ -47,6 +49,7 @@ func (o *Options) HTTPRequestTimeout() uint {

// HttpRequestTimeout returns HTTP request timeout.
// Deprecated: Use HTTPRequestTimeout instead.
//lint:ignore ST1003 Deprecated method to be removed in the next release
func (o *Options) HttpRequestTimeout() uint {
return o.HTTPRequestTimeout()
}
@@ -59,6 +62,7 @@ func (o *Options) SetHTTPRequestTimeout(httpRequestTimeout uint) *Options {

// SetHttpRequestTimeout sets HTTP request timeout in sec.
// Deprecated: Use SetHTTPRequestTimeout instead.
//lint:ignore ST1003 Deprecated method to be removed in the next release
func (o *Options) SetHttpRequestTimeout(httpRequestTimeout uint) *Options {
return o.SetHTTPRequestTimeout(httpRequestTimeout)
}
3 changes: 3 additions & 0 deletions api/labels_deprecated.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ import (
"github.com/influxdata/influxdb-client-go/domain"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release.

// LabelsApi provides methods for managing labels in a InfluxDB server.
// Deprecated: Use LabelsAPI instead.
type LabelsApi interface {
@@ -43,6 +45,7 @@ type labelsApiImpl struct {
labelsAPI LabelsAPI
}

// NewLabelsApi creates instance of LabelsApi
// Deprecated: use NewLabelsAPI instead.
func NewLabelsApi(apiClient *domain.ClientWithResponses) LabelsApi {
return &labelsApiImpl{
3 changes: 3 additions & 0 deletions api/organizations_deprecated.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ import (
"github.com/influxdata/influxdb-client-go/domain"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release.

// OrganizationsApi provides methods for managing Organizations in a InfluxDB server.
// Deprecated: Use OrganizationsAPI instead.
type OrganizationsApi interface {
@@ -72,6 +74,7 @@ type organizationsApiImpl struct {
organizationsAPI OrganizationsAPI
}

// NewOrganizationsApi creates instance of OrganizationsApi
// Deprecated: use NewOrganizationsAPI instead.
func NewOrganizationsApi(apiClient *domain.ClientWithResponses) OrganizationsApi {
return &organizationsApiImpl{
2 changes: 2 additions & 0 deletions api/query_deprecated.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ import (
"github.com/influxdata/influxdb-client-go/domain"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release.

// QueryApi provides methods for performing synchronously flux query against InfluxDB server.
// Deprecated: Use QueryAPI instead.
type QueryApi interface {
3 changes: 3 additions & 0 deletions api/users_deprecated.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ import (
"github.com/influxdata/influxdb-client-go/domain"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release.

// UsersApi provides methods for managing users in a InfluxDB server.
// Deprecated: use UsersAPI instead.
type UsersApi interface {
@@ -42,6 +44,7 @@ type usersApiImpl struct {
usersAPI UsersAPI
}

// NewUsersApi creates instance of UsersApi
// Deprecated: use NewUsersAPI instead.
func NewUsersApi(apiClient *domain.ClientWithResponses) UsersApi {
return &usersApiImpl{
2 changes: 1 addition & 1 deletion api/writeApiBlocking.go
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ type writeAPIBlocking struct {
writeOptions *write.Options
}

// creates writeAPIBlocking for org and bucket with underlying client
// NewWriteAPIBlocking creates new WriteAPIBlocking instance for org and bucket with underlying client
func NewWriteAPIBlocking(org string, bucket string, service http.Service, writeOptions *write.Options) *writeAPIBlocking {
return &writeAPIBlocking{service: iwrite.NewService(org, bucket, service, writeOptions), writeOptions: writeOptions}
}
2 changes: 2 additions & 0 deletions api/write_deprecated.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ import (
"github.com/influxdata/influxdb-client-go/api/write"
)

//lint:file-ignore ST1003 This is deprecated API to be removed in next release.

// WriteApi is Write client interface with non-blocking methods for writing time series data asynchronously in batches into an InfluxDB server.
// Deprecated: Use WriteAPI instead.
type WriteApi interface {
44 changes: 31 additions & 13 deletions client.go
Original file line number Diff line number Diff line change
@@ -97,24 +97,30 @@ type clientImpl struct {
httpService ihttp.Service
apiClient *domain.ClientWithResponses
authAPI api.AuthorizationsAPI
authApi api.AuthorizationsApi
orgAPI api.OrganizationsAPI
orgApi api.OrganizationsApi
usersApi api.UsersApi
usersAPI api.UsersAPI
deleteAPI api.DeleteAPI
deleteApi api.DeleteApi
bucketsAPI api.BucketsAPI
bucketsApi api.BucketsApi
labelsApi api.LabelsApi
labelsAPI api.LabelsAPI
//lint:ignore ST1003 Field for deprecated API to be removed in the next release
authApi api.AuthorizationsApi
orgAPI api.OrganizationsAPI
//lint:ignore ST1003 Field for deprecated API to be removed in the next release
orgApi api.OrganizationsApi
//lint:ignore ST1003 Field for deprecated API to be removed in the next release
usersApi api.UsersApi
usersAPI api.UsersAPI
deleteAPI api.DeleteAPI
//lint:ignore ST1003 Field for deprecated API to be removed in the next release
deleteApi api.DeleteApi
bucketsAPI api.BucketsAPI
//lint:ignore ST1003 Field for deprecated API to be removed in the next release
bucketsApi api.BucketsApi
//lint:ignore ST1003 Field for deprecated API to be removed in the next release
labelsApi api.LabelsApi
labelsAPI api.LabelsAPI
}

// NewClient creates Client for connecting to given serverURL with provided authentication token, with the default options.
// Authentication token can be empty in case of connecting to newly installed InfluxDB server, which has not been set up yet.
// In such case Setup will set authentication token
func NewClient(serverUrl string, authToken string) Client {
return NewClientWithOptions(serverUrl, authToken, DefaultOptions())
func NewClient(serverURL string, authToken string) Client {
return NewClientWithOptions(serverURL, authToken, DefaultOptions())
}

// NewClientWithOptions creates Client for connecting to given serverURL with provided authentication token
@@ -146,6 +152,7 @@ func (c *clientImpl) ServerURL() string {
return c.serverURL
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) ServerUrl() string {
return c.serverURL
}
@@ -204,6 +211,7 @@ func (c *clientImpl) Health(ctx context.Context) (*domain.HealthCheck, error) {
return response.JSON200, nil
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) WriteApi(org, bucket string) api.WriteApi {
return c.WriteAPI(org, bucket)
}
@@ -213,6 +221,8 @@ func (c *clientImpl) WriteAPI(org, bucket string) api.WriteAPI {
c.writeAPIs = append(c.writeAPIs, w)
return w
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) WriteApiBlocking(org, bucket string) api.WriteApiBlocking {
return c.WriteAPIBlocking(org, bucket)
}
@@ -231,6 +241,8 @@ func (c *clientImpl) Close() {
func (c *clientImpl) QueryAPI(org string) api.QueryAPI {
return api.NewQueryAPI(org, c.httpService)
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) QueryApi(org string) api.QueryApi {
return c.QueryAPI(org)
}
@@ -244,6 +256,7 @@ func (c *clientImpl) AuthorizationsAPI() api.AuthorizationsAPI {
return c.authAPI
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) AuthorizationsApi() api.AuthorizationsApi {
c.lock.Lock()
defer c.lock.Unlock()
@@ -262,6 +275,7 @@ func (c *clientImpl) OrganizationsAPI() api.OrganizationsAPI {
return c.orgAPI
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) OrganizationsApi() api.OrganizationsApi {
c.lock.Lock()
defer c.lock.Unlock()
@@ -280,6 +294,7 @@ func (c *clientImpl) UsersAPI() api.UsersAPI {
return c.usersAPI
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) UsersApi() api.UsersApi {
c.lock.Lock()
defer c.lock.Unlock()
@@ -298,6 +313,7 @@ func (c *clientImpl) DeleteAPI() api.DeleteAPI {
return c.deleteAPI
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) DeleteApi() api.DeleteApi {
c.lock.Lock()
defer c.lock.Unlock()
@@ -316,6 +332,7 @@ func (c *clientImpl) BucketsAPI() api.BucketsAPI {
return c.bucketsAPI
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) BucketsApi() api.BucketsApi {
c.lock.Lock()
defer c.lock.Unlock()
@@ -334,6 +351,7 @@ func (c *clientImpl) LabelsAPI() api.LabelsAPI {
return c.labelsAPI
}

//lint:ignore ST1003 Deprecated method to be removed in the next release
func (c *clientImpl) LabelsApi() api.LabelsApi {
c.lock.Lock()
defer c.lock.Unlock()
Loading