Skip to content

Commit a5adf93

Browse files
committedNov 18, 2022
移除github.com/prometheus/common/依赖
更新到golang 1.19
1 parent 37eadd0 commit a5adf93

File tree

7 files changed

+92
-65
lines changed

7 files changed

+92
-65
lines changed
 

‎example/consul.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package main
33
import (
44
"fmt"
55
"github.com/hashicorp/consul/api"
6-
"github.com/prometheus/common/log"
6+
log "github.com/sirupsen/logrus"
77
"github.com/tietang/props/v3/consul"
88
"github.com/tietang/props/v3/kvs"
99
"time"
1010
)
1111

12-
/**
12+
/*
13+
*
1314
1415
conf/ini/demo1 = `
1516
@@ -23,25 +24,20 @@ y1=val1
2324
2425
`
2526
26-
2727
conf/ini_props/ =
2828
conf/ini_props/x0 = y0=val0
2929
y1=val1
3030
conf/ini_props/x1 = y1=val1
3131
32-
3332
conf/kv/ =
3433
conf/kv/x0/y0 = val0
3534
conf/kv/x1/y1 = val1
3635
37-
3836
conf/props/ =
3937
conf/props/demo1 = x0.y0=val0
4038
x1.y1=val1
4139
conf/props/demo2 = k.y=val0
4240
k2.y2=val2
43-
44-
4541
*/
4642
func main_3() {
4743
address := "127.0.0.1:8500"

‎go.mod

+49-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/tietang/props/v3
22

3-
go 1.12
3+
go 1.19
44

55
//被墙的原因,替换golang.org源为github.com源
66
replace (
@@ -16,7 +16,7 @@ replace (
1616
golang.org/x/oauth2 => github.com/golang/oauth2 v0.0.0-20190319182350-c85d3e98c914
1717
golang.org/x/perf => github.com/golang/perf v0.0.0-20190312170614-0655857e383f
1818
golang.org/x/sync => github.com/golang/sync v0.0.0-20190227155943-e225da77a7e6
19-
golang.org/x/sys => github.com/golang/sys v0.0.0-20190322080309-f49334f85ddc
19+
//golang.org/x/sys => github.com/golang/sys v0.0.0-20190322080309-f49334f85ddc
2020
golang.org/x/text => github.com/golang/text v0.3.0
2121
golang.org/x/time => github.com/golang/time v0.0.0-20190308202827-9d24e82272b4
2222
golang.org/x/tools => github.com/golang/tools v0.0.0-20190327011446-79af862e6737
@@ -27,50 +27,80 @@ replace (
2727
)
2828

2929
require (
30-
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
30+
github.com/coreos/etcd v3.3.13+incompatible
31+
github.com/go-ini/ini v1.67.0
32+
github.com/hashicorp/consul/api v1.4.0
33+
github.com/nacos-group/nacos-sdk-go v1.0.1
34+
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec
35+
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
36+
github.com/sirupsen/logrus v1.9.0
37+
github.com/smartystreets/goconvey v1.6.4
38+
github.com/tietang/go-utils v0.1.3
39+
github.com/valyala/fasttemplate v1.2.2
40+
gopkg.in/yaml.v2 v2.4.0
41+
)
42+
43+
require (
44+
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 // indirect
3145
github.com/armon/go-metrics v0.3.3 // indirect
46+
github.com/buger/jsonparser v1.1.1 // indirect
3247
github.com/coreos/bbolt v1.3.2 // indirect
33-
github.com/coreos/etcd v3.3.13+incompatible
3448
github.com/coreos/go-semver v0.3.0 // indirect
3549
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect
3650
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
3751
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
38-
github.com/go-ini/ini v1.57.0
52+
github.com/fatih/color v1.9.0 // indirect
53+
github.com/go-errors/errors v1.0.1 // indirect
3954
github.com/gogo/protobuf v1.2.1 // indirect
4055
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
56+
github.com/golang/mock v1.6.0 // indirect
57+
github.com/golang/protobuf v1.5.2 // indirect
4158
github.com/google/btree v1.0.0 // indirect
4259
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
4360
github.com/gorilla/websocket v1.4.0 // indirect
4461
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
4562
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
4663
github.com/grpc-ecosystem/grpc-gateway v1.9.0 // indirect
47-
github.com/hashicorp/consul/api v1.4.0
64+
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
65+
github.com/hashicorp/go-hclog v0.12.0 // indirect
4866
github.com/hashicorp/go-immutable-radix v1.2.0 // indirect
4967
github.com/hashicorp/go-msgpack v0.5.5 // indirect
68+
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
5069
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
5170
github.com/hashicorp/golang-lru v0.5.4 // indirect
5271
github.com/hashicorp/serf v0.9.2 // indirect
72+
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
73+
github.com/json-iterator/go v1.1.12 // indirect
74+
github.com/jtolds/gls v4.20.0+incompatible // indirect
75+
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f // indirect
76+
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect
77+
github.com/mattn/go-colorable v0.1.6 // indirect
78+
github.com/mattn/go-isatty v0.0.12 // indirect
79+
github.com/mitchellh/go-homedir v1.1.0 // indirect
5380
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
5481
github.com/mitchellh/mapstructure v1.3.2 // indirect
55-
github.com/nacos-group/nacos-sdk-go v1.0.1
56-
github.com/prometheus/common v0.10.0
57-
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec
58-
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
59-
github.com/sirupsen/logrus v1.6.0
82+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
83+
github.com/modern-go/reflect2 v1.0.2 // indirect
84+
github.com/pkg/errors v0.9.1 // indirect
85+
github.com/prometheus/client_golang v1.12.2 // indirect
6086
github.com/smartystreets/assertions v1.1.1 // indirect
61-
github.com/smartystreets/goconvey v1.6.4
6287
github.com/soheilhy/cmux v0.1.4 // indirect
63-
github.com/tietang/go-utils v0.1.3
6488
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
65-
github.com/valyala/fasttemplate v1.1.0
89+
github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 // indirect
90+
github.com/valyala/bytebufferpool v1.0.0 // indirect
6691
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
67-
go.etcd.io/bbolt v1.3.2 // indirect
92+
go.uber.org/atomic v1.7.0 // indirect
93+
go.uber.org/multierr v1.6.0 // indirect
94+
go.uber.org/zap v1.21.0 // indirect
6895
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 // indirect
69-
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
70-
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
96+
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
97+
golang.org/x/sys v0.2.0 // indirect
98+
golang.org/x/text v0.3.2 // indirect
99+
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
71100
google.golang.org/genproto v0.0.0-20190605220351-eb0b1bdb6ae6 // indirect
72-
google.golang.org/grpc v1.23.0 // indirect
73-
gopkg.in/yaml.v2 v2.2.8
101+
google.golang.org/grpc v1.48.0 // indirect
102+
google.golang.org/protobuf v1.26.0 // indirect
103+
gopkg.in/ini.v1 v1.66.2 // indirect
74104
)
75105

76106
//exclude (

‎kvs/config_composite.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package kvs
22

33
import (
44
"errors"
5-
"github.com/prometheus/common/log"
5+
log "github.com/sirupsen/logrus"
66
"github.com/valyala/fasttemplate"
77
"io"
88
"os"
@@ -11,7 +11,6 @@ import (
1111
"time"
1212
)
1313

14-
//
1514
type CompositeConfigSource struct {
1615
ConfName string
1716
ConfigSources []ConfigSource //Set

‎kvs/eval.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package kvs
22

33
import (
44
"errors"
5-
"github.com/prometheus/common/log"
5+
log "github.com/sirupsen/logrus"
66
"github.com/valyala/fasttemplate"
77
"io"
88
"regexp"

‎kvs/helper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"bytes"
66
"errors"
77
"fmt"
8-
"github.com/prometheus/common/log"
8+
log "github.com/sirupsen/logrus"
99
"io"
1010
"io/ioutil"
1111
"os"

‎yam/helper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package yam
22

33
import (
4-
"github.com/prometheus/common/log"
4+
log "github.com/sirupsen/logrus"
55
"github.com/tietang/props/v3/kvs"
66
"strings"
77
)

‎zk/zk_source.go

+36-34
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package zk
22

33
import (
4-
"github.com/prometheus/common/log"
54
"github.com/samuel/go-zookeeper/zk"
5+
log "github.com/sirupsen/logrus"
66
"github.com/tietang/props/v3/ini"
77
"github.com/tietang/props/v3/kvs"
88
"github.com/tietang/props/v3/yam"
@@ -30,22 +30,24 @@ context: /configs/dev/app
3030
如果是ContentType=ini_props,则zk nodes:
3131
3232
/configs/dev/app
33-
- /jdbc:
34-
```
35-
url=tcp(127.0.0.1:3306)/Test?charset=utf8
36-
username=root
37-
password=root
38-
timeout=6s
39-
40-
```
41-
- /redis:
42-
```
43-
host=192.168.1.123
44-
port=6379
45-
database=2
46-
timeout=6s
47-
password=password
48-
```
33+
34+
- /jdbc:
35+
```
36+
url=tcp(127.0.0.1:3306)/Test?charset=utf8
37+
username=root
38+
password=root
39+
timeout=6s
40+
41+
```
42+
43+
- /redis:
44+
```
45+
host=192.168.1.123
46+
port=6379
47+
database=2
48+
timeout=6s
49+
password=password
50+
```
4951
5052
如果是如下中的一个,
5153
ContentProperties contentType = "properties"
@@ -55,31 +57,31 @@ ContentYam contentType = "yam" //yaml 别名
5557
ContentYml contentType = "yml" //yaml 别名
5658
ContentIni contentType = "ini"
5759
58-
5960
则zk nodes,last key以对应的配置格式,就如同文件名一样,
6061
比如key为mysql,配置格式为yml,则在zookeeper中配置的key为mysql.yml
6162
那么完成的zk path就为,/configs/dev/app/mysql.yml=`k/v...`
6263
6364
比如properties,或者props
6465
6566
/configs/dev/app
66-
- /jdbc.props:
67-
```
68-
jdbc.url=tcp(127.0.0.1:3306)/Test?charset=utf8
69-
jdbc.username=root
70-
jdbc.password=root
71-
jdbc.timeout=6s
72-
73-
```
74-
- /redis.props:
75-
```
76-
redis.host=192.168.1.123
77-
redis.port=6379
78-
redis.database=2
79-
redis.timeout=6s
80-
redis.password=password
81-
```
8267
68+
- /jdbc.props:
69+
```
70+
jdbc.url=tcp(127.0.0.1:3306)/Test?charset=utf8
71+
jdbc.username=root
72+
jdbc.password=root
73+
jdbc.timeout=6s
74+
75+
```
76+
77+
- /redis.props:
78+
```
79+
redis.host=192.168.1.123
80+
redis.port=6379
81+
redis.database=2
82+
redis.timeout=6s
83+
redis.password=password
84+
```
8385
*/
8486
type ZookeeperConfigSource struct {
8587
ZookeeperSource

0 commit comments

Comments
 (0)
Please sign in to comment.