diff --git a/attrmgr/attrmgr.go b/attrmgr/attrmgr.go index 7c692ca..2b36d97 100644 --- a/attrmgr/attrmgr.go +++ b/attrmgr/attrmgr.go @@ -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 ( diff --git a/influxdb/client.go b/influxdb/client.go index abd68f6..96c25b0 100644 --- a/influxdb/client.go +++ b/influxdb/client.go @@ -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 { diff --git a/influxdb/client/influxdb.go b/influxdb/client/influxdb.go index e9a6abe..06223c8 100644 --- a/influxdb/client/influxdb.go +++ b/influxdb/client/influxdb.go @@ -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 ( diff --git a/influxdb/client/models/inline_fnv.go b/influxdb/client/models/inline_fnv.go index 56ea170..1abc5ca 100644 --- a/influxdb/client/models/inline_fnv.go +++ b/influxdb/client/models/inline_fnv.go @@ -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 diff --git a/influxdb/client/models/inline_strconv_parse.go b/influxdb/client/models/inline_strconv_parse.go index 7df84e7..9e0e300 100644 --- a/influxdb/client/models/inline_strconv_parse.go +++ b/influxdb/client/models/inline_strconv_parse.go @@ -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 ( diff --git a/influxdb/client/models/points.go b/influxdb/client/models/points.go index 7a8a709..fc2f329 100644 --- a/influxdb/client/models/points.go +++ b/influxdb/client/models/points.go @@ -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 ( diff --git a/influxdb/client/models/rows.go b/influxdb/client/models/rows.go index 1d10292..c087a48 100644 --- a/influxdb/client/models/rows.go +++ b/influxdb/client/models/rows.go @@ -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 ( diff --git a/influxdb/client/models/statistic.go b/influxdb/client/models/statistic.go index 4c963b1..553e9d0 100644 --- a/influxdb/client/models/statistic.go +++ b/influxdb/client/models/statistic.go @@ -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. diff --git a/influxdb/client/models/time.go b/influxdb/client/models/time.go index cb46414..e98f2cb 100644 --- a/influxdb/client/models/time.go +++ b/influxdb/client/models/time.go @@ -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 diff --git a/influxdb/client/models/uint_support.go b/influxdb/client/models/uint_support.go index dcff490..f6d31ae 100644 --- a/influxdb/client/models/uint_support.go +++ b/influxdb/client/models/uint_support.go @@ -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() { diff --git a/influxdb/client/pkg/escape/bytes.go b/influxdb/client/pkg/escape/bytes.go index e2a6ab7..26ffd0c 100644 --- a/influxdb/client/pkg/escape/bytes.go +++ b/influxdb/client/pkg/escape/bytes.go @@ -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 ( diff --git a/influxdb/client/pkg/escape/strings.go b/influxdb/client/pkg/escape/strings.go index 5de0a01..db98033 100644 --- a/influxdb/client/pkg/escape/strings.go +++ b/influxdb/client/pkg/escape/strings.go @@ -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" diff --git a/influxdb/client/v2/client.go b/influxdb/client/v2/client.go index 0662156..4c099e1 100644 --- a/influxdb/client/v2/client.go +++ b/influxdb/client/v2/client.go @@ -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 ( diff --git a/influxdb/client/v2/params.go b/influxdb/client/v2/params.go index 238ef66..5616bfb 100644 --- a/influxdb/client/v2/params.go +++ b/influxdb/client/v2/params.go @@ -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 ( diff --git a/influxdb/client/v2/udp.go b/influxdb/client/v2/udp.go index c548a0e..9867868 100644 --- a/influxdb/client/v2/udp.go +++ b/influxdb/client/v2/udp.go @@ -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 ( diff --git a/influxdb/config.go b/influxdb/config.go index ea763ad..0d5dd74 100644 --- a/influxdb/config.go +++ b/influxdb/config.go @@ -1,26 +1,24 @@ -/* -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"` @@ -28,14 +26,15 @@ type Config struct { 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"` diff --git a/influxdb/metrics.go b/influxdb/metrics.go index a920a7b..cfe2ce7 100644 --- a/influxdb/metrics.go +++ b/influxdb/metrics.go @@ -1,15 +1,13 @@ -/* -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 @@ -17,7 +15,6 @@ import ( "errors" "fmt" "github.com/ztalab/zta-tools/influxdb/client/v2" - "github.com/ztalab/zta-tools/logger" "io" "strings" "sync" @@ -51,13 +48,12 @@ type Response struct { } // NewMetrics ... -func NewMetrics(influxDBHttpClient *HTTPClient, conf *CustomConfig) (metrics *Metrics) { +func NewMetrics(influxDBHttpClient *HTTPClient, conf *CustomConfig) (*Metrics, error) { bp, err := client.NewBatchPoints(influxDBHttpClient.BatchPointsConfig) if err != nil { - logger.Errorf("custom-influxdb client.NewBatchPoints err: %v", err) - return + return nil, err } - metrics = &Metrics{ + metrics := &Metrics{ conf: conf, batchPoints: bp, point: make(chan *client.Point, 16), @@ -65,20 +61,16 @@ func NewMetrics(influxDBHttpClient *HTTPClient, conf *CustomConfig) (metrics *Me InfluxDBHttpClient: influxDBHttpClient, } go metrics.worker() - return + return metrics, nil } -func (mt *Metrics) AddPoint(metricsData *MetricsData) { - if mt == nil { - return - } - //atomic.AddUint64(&mt.counter, 1) +func (mt *Metrics) AddPoint(metricsData *MetricsData) error { pt, err := client.NewPoint(metricsData.Measurement, metricsData.Tags, metricsData.Fields, time.Now()) if err != nil { - logger.Errorf("custom-influxdb client.NewPoint err: %s", err) - return + return err } mt.point <- pt + return nil } func (mt *Metrics) worker() { @@ -90,7 +82,6 @@ func (mt *Metrics) worker() { return } mt.batchPoints.AddPoint(p) - // When the number of points reaches 50, send data if mt.batchPoints.GetPointsNum() >= mt.conf.FlushSize { mt.flush() } @@ -100,26 +91,26 @@ func (mt *Metrics) worker() { } } -func (mt *Metrics) flush() { +func (mt *Metrics) flush() error { mt.mu.Lock() defer mt.mu.Unlock() if mt.batchPoints.GetPointsNum() == 0 { - return + return nil } err := mt.Write() if err != nil { if strings.Contains(err.Error(), io.EOF.Error()) { err = nil } else { - logger.Errorf("custom-influxdb client.Write err: %s", err) + fmt.Println("custom-influxdb client.Write err:", err) + return err } } defer mt.InfluxDBHttpClient.FluxDBHttpClose() - // Clear all points mt.batchPoints.ClearPoints() + return nil } -// Write data timeout processing func (mt *Metrics) Write() error { ch := make(chan error, 1) go func() { @@ -136,6 +127,6 @@ func (mt *Metrics) Write() error { func (mt *Metrics) count() { for { time.Sleep(time.Second) - fmt.Println("Counter:", atomic.LoadUint64(&mt.counter)) + fmt.Println("counter:", atomic.LoadUint64(&mt.counter)) } } diff --git a/memorycacher/cache.go b/memorycacher/cache.go index 56f3939..6e1b8f1 100644 --- a/memorycacher/cache.go +++ b/memorycacher/cache.go @@ -6,19 +6,6 @@ * @FilePath: /ServiceCar/utils/memorycache/cache.go */ -/* -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 memorycacher import ( @@ -78,7 +65,7 @@ type cache struct { janitor *janitor } -//Determine whether the amount of schema inside the map schema structure has reached the maximum number limit +// Determine whether the amount of schema inside the map schema structure has reached the maximum number limit func (c *cache) IsReachMaxItemsCount() bool { return c.ItemCount() >= c.maxItemsCount } @@ -227,7 +214,7 @@ func (c *cache) get(k string) (interface{}, bool) { return item.Object, true } -//send map clean to cache janitor +// send map clean to cache janitor func (c *cache) ShoudClean() { if c.janitor.shoudClean == nil { return diff --git a/memorycacher/cache_test.go b/memorycacher/cache_test.go index 209a237..c58d56c 100644 --- a/memorycacher/cache_test.go +++ b/memorycacher/cache_test.go @@ -6,19 +6,6 @@ * @FilePath: /ServiceCar/utils/memorycacher/cache_test.go */ -/* -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 memorycacher import ( diff --git a/memorycacher/sharded.go b/memorycacher/sharded.go index e507068..87b5a5d 100644 --- a/memorycacher/sharded.go +++ b/memorycacher/sharded.go @@ -6,19 +6,6 @@ * @FilePath: /ServiceCar/utils/memorycache/sharded.go */ -/* -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 memorycacher import ( diff --git a/memorycacher/sharded_test.go b/memorycacher/sharded_test.go index 19fe6cc..907c858 100644 --- a/memorycacher/sharded_test.go +++ b/memorycacher/sharded_test.go @@ -5,19 +5,6 @@ * @LastEditTime: 2020-07-10 10:06:42 * @FilePath: /ServiceCar/utils/memorycacher/sharded_test.go */ -/* -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 memorycacher import ( diff --git a/pkg/keygen/genkey.go b/pkg/keygen/genkey.go index 7b2f4cb..d115f5a 100644 --- a/pkg/keygen/genkey.go +++ b/pkg/keygen/genkey.go @@ -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 keygen import ( diff --git a/pkg/keygen/genkey_test.go b/pkg/keygen/genkey_test.go index b28ae79..449cc78 100644 --- a/pkg/keygen/genkey_test.go +++ b/pkg/keygen/genkey_test.go @@ -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 keygen import ( diff --git a/pkg/keyprovider/xkey_provider.go b/pkg/keyprovider/xkey_provider.go index 7574be7..787480b 100644 --- a/pkg/keyprovider/xkey_provider.go +++ b/pkg/keyprovider/xkey_provider.go @@ -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 keyprovider import ( diff --git a/pkg/keyprovider/xkey_provider_test.go b/pkg/keyprovider/xkey_provider_test.go index 98c73c6..ff99efe 100644 --- a/pkg/keyprovider/xkey_provider_test.go +++ b/pkg/keyprovider/xkey_provider_test.go @@ -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 keyprovider import ( diff --git a/pkg/signer/handler.go b/pkg/signer/handler.go index a1a7ce6..ffe438c 100644 --- a/pkg/signer/handler.go +++ b/pkg/signer/handler.go @@ -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 signer import ( diff --git a/pkg/spiffe/idg.go b/pkg/spiffe/idg.go index 0aded9c..02ae73a 100644 --- a/pkg/spiffe/idg.go +++ b/pkg/spiffe/idg.go @@ -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 spiffe import ( diff --git a/pkg/spiffe/idg_test.go b/pkg/spiffe/idg_test.go index 4a68221..dcdd81f 100644 --- a/pkg/spiffe/idg_test.go +++ b/pkg/spiffe/idg_test.go @@ -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 spiffe import ( diff --git a/pkg/spiffe/peer_verifier.go b/pkg/spiffe/peer_verifier.go index 7a29055..b6bd999 100644 --- a/pkg/spiffe/peer_verifier.go +++ b/pkg/spiffe/peer_verifier.go @@ -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 spiffe import (