Skip to content

Commit

Permalink
fix: check
Browse files Browse the repository at this point in the history
  • Loading branch information
Murphy-hub committed Feb 8, 2023
1 parent 891c4e2 commit 528a979
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 439 deletions.
13 changes: 0 additions & 13 deletions attrmgr/attrmgr.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package attrmgr

import (
Expand Down
52 changes: 11 additions & 41 deletions influxdb/client.go
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Copyright 2022-present The ZTDBP Authors.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package influxdb

import (
_ "github.com/ztalab/zta-tools/influxdb/client" // this is important because of the bug in go mod
client "github.com/ztalab/zta-tools/influxdb/client/v2"
"github.com/ztalab/zta-tools/logger"
)

// UDPClient UDP Client
type UDPClient struct {
Conf *Config
BatchPointsConfig client.BatchPointsConfig
client client.Client
}

func (p *UDPClient) newUDPV1Client() *UDPClient {
udpClient, err := client.NewUDPClient(client.UDPConfig{
Addr: p.Conf.UDPAddress,
})
if err != nil {
logger.Errorf("InfluxDBUDPClient err: %v", err)
}
p.client = udpClient
return p
}

// FluxDBUDPWrite ...
func (p *UDPClient) FluxDBUDPWrite(bp client.BatchPoints) (err error) {
err = p.newUDPV1Client().client.Write(bp)
return
}
import "github.com/ztalab/zta-tools/influxdb/client/v2"

// HTTPClient HTTP Client
type HTTPClient struct {
Expand Down
15 changes: 2 additions & 13 deletions influxdb/client/influxdb.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package client implements a now-deprecated client for InfluxDB;
// use github.com/ztalab/zta-tools/influxdb/client/v2 instead.
package client // import "github.com/ztalab/zta-tools/influxdb/client"

import (
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/models/inline_fnv.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package models // import "github.com/ztalab/zta-tools/influxdb/client/models"

// from stdlib hash/fnv/fnv.go
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/models/inline_strconv_parse.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package models // import "github.com/ztalab/zta-tools/influxdb/client/models"

import (
Expand Down
14 changes: 1 addition & 13 deletions influxdb/client/models/points.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package models implements basic objects used throughout the TICK stack.
package models // import "github.com/ztalab/zta-tools/influxdb/client/models"

import (
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/models/rows.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package models

import (
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/models/statistic.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package models

// Statistic is the representation of a statistic used by the monitoring service.
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/models/time.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package models

// Helper time methods since parsing time can easily overflow and we only support a
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/models/uint_support.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
//go:build uint || uint64
// +build uint uint64

/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package models

func init() {
Expand Down
14 changes: 1 addition & 13 deletions influxdb/client/pkg/escape/bytes.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
// Package escape contains utilities for escaping parts of InfluxQL
// and InfluxDB line protocol.
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package escape // import "github.com/ztalab/zta-tools/influxdb/client/pkg/escape"

import (
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/pkg/escape/strings.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package escape

import "strings"
Expand Down
14 changes: 1 addition & 13 deletions influxdb/client/v2/client.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package client (v2) is the current official Go client for InfluxDB.
package client // import "github.com/ztalab/zta-tools/influxdb/client/v2"

import (
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/v2/params.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package client

import (
Expand Down
13 changes: 0 additions & 13 deletions influxdb/client/v2/udp.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package client

import (
Expand Down
51 changes: 25 additions & 26 deletions influxdb/config.go
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
/*
Copyright 2022-present The ZTDBP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Copyright 2022-present The ZTDBP Authors.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package influxdb

// Config configuration
type Config struct {
Enable bool `yaml:"enable"` //Service switch
Address string `yaml:"address"`
Port int `yaml:"port"`
UDPAddress string `yaml:"udp_address"` //influxdb UDP address of the database,ip:port
Database string `yaml:"database"` //Database name
Precision string `yaml:"precision"` //Accuracy n, u, ms, s, m or h
Enable bool `yaml:"enable"`
Address string `yaml:"address"`
Port int `yaml:"port"`
UDPAddress string `yaml:"udp_address"`
Database string `yaml:"database"`
// precision: n, u, ms, s, m or h
Precision string `yaml:"precision"`
UserName string `yaml:"username"`
Password string `yaml:"password"`
MaxIdleConns int `yaml:"max-idle-conns"`
MaxIdleConnsPerHost int `yaml:"max-idle-conns-per-host"`
IdleConnTimeout int `yaml:"idle-conn-timeout"`
}

// CustomConfig Custom configuration
// CustomConfig Custom Configuration
type CustomConfig struct {
Enabled bool `yaml:"enabled"` //Service switch
Address string `yaml:"address"`
Port int `yaml:"port"`
UDPAddress string `yaml:"udp_address"` //influxdb UDP address of the database,ip:port
Database string `yaml:"database"` //Database name
Precision string `yaml:"precision"` //Accuracy n, u, ms, s, m or h
Enabled bool `yaml:"enabled"`
Address string `yaml:"address"`
Port int `yaml:"port"`
UDPAddress string `yaml:"udp_address"`
Database string `yaml:"database"`
// precision: n, u, ms, s, m or h
Precision string `yaml:"precision"`
UserName string `yaml:"username"`
Password string `yaml:"password"`
ReadUserName string `yaml:"read-username"`
Expand Down
Loading

0 comments on commit 528a979

Please sign in to comment.