Skip to content

Commit

Permalink
chore: update dep
Browse files Browse the repository at this point in the history
  • Loading branch information
hyacinthus committed Oct 28, 2023
1 parent 628ef80 commit 22282cd
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 315 deletions.
10 changes: 5 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sort"
"strings"

"github.com/hyacinthus/x/xobj"
"github.com/hack-fan/x/xobj"
"github.com/levigross/grequests"
)

Expand Down Expand Up @@ -56,17 +56,17 @@ func NewFromReader(p, c, a io.Reader) *Client {

// NewFromCOS 从腾讯云对象存储获取数据 用了我的其他库 内网速度快
func NewFromCOS(cos xobj.Client) *Client {
p, err := cos.Reader("/division/provinces.csv")
p, err := cos.GetReader("/division/provinces.csv")
if err != nil {
panic(err)
}
defer p.Close()
c, err := cos.Reader("/division/cities.csv")
c, err := cos.GetReader("/division/cities.csv")
if err != nil {
panic(err)
}
defer c.Close()
a, err := cos.Reader("/division/areas.csv")
a, err := cos.GetReader("/division/areas.csv")
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -389,7 +389,7 @@ func (c *Client) GetPCA() (io.ReadCloser, error) {
case ProviderGithub:
return grequests.Get(c.base+"pca-code.json", nil)
case ProviderCOS:
return c.cos.Reader("/division/pca-code.json")
return c.cos.GetReader("/division/pca-code.json")
}
return nil, errors.New("没有可用的数据源")
}
31 changes: 9 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,13 @@ module github.com/hyacinthus/addresscn
go 1.13

require (
cloud.google.com/go v0.44.3 // indirect
github.com/apache/thrift v0.12.0 // indirect
github.com/go-redis/cache v6.4.0+incompatible // indirect
github.com/go-redis/redis v6.15.6+incompatible // indirect
github.com/google/go-cmp v0.3.1 // indirect
github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/hyacinthus/x v0.0.0-20200302100126-2c352df435a5
github.com/kr/pty v1.1.8 // indirect
github.com/levigross/grequests v0.0.0-20190908174114-253788527a1a
github.com/openzipkin/zipkin-go v0.1.6 // indirect
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.4.0
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20200311031902-5eb2ce1f587d // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
golang.org/x/mobile v0.0.0-20190814143026-e8b3e6111d02 // indirect
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect
golang.org/x/tools v0.0.0-20190820033707-85edb9ef3283 // indirect
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
google.golang.org/grpc v1.23.0 // indirect
honnef.co/go/tools v0.0.1-2019.2.2 // indirect
github.com/hack-fan/x/xobj v0.0.0-20220710091142-d0aa872f816c
github.com/labstack/echo/v4 v4.11.2 // indirect
github.com/levigross/grequests v0.0.0-20221222020224-9eee758d18d5
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mozillazg/go-httpheader v0.4.0 // indirect
github.com/stretchr/testify v1.8.4
github.com/tencentyun/cos-go-sdk-v5 v0.7.45 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)

0 comments on commit 22282cd

Please sign in to comment.