Skip to content

Commit

Permalink
Merge branch 'master' into c
Browse files Browse the repository at this point in the history
  • Loading branch information
Reasno authored Jan 19, 2022
2 parents 63aed4a + 99d0912 commit be45e0d
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 45 deletions.
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.17
require (
github.com/ClickHouse/clickhouse-go v1.4.5 // indirect
github.com/aws/aws-sdk-go v1.40.45
github.com/felixge/httpsnoop v1.0.1
github.com/fsnotify/fsnotify v1.4.9
github.com/gabriel-vasile/mimetype v1.1.2
github.com/go-gormigrate/gormigrate/v2 v2.0.0
Expand All @@ -17,7 +18,7 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/heptiolabs/healthcheck v0.0.0-20180807145615-6ff867650f40
github.com/knadh/koanf v0.15.0
github.com/knadh/koanf v1.4.0
github.com/mitchellh/mapstructure v1.4.2
github.com/oklog/run v1.1.0
github.com/olivere/elastic/v7 v7.0.22
Expand Down Expand Up @@ -50,8 +51,6 @@ require (
gorm.io/gorm v1.21.10
)

require github.com/felixge/httpsnoop v1.0.1

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
Expand All @@ -76,6 +75,8 @@ require (
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-sqlite3 v1.14.5 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down
20 changes: 17 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@ github.com/aws/aws-sdk-go v1.40.45 h1:QN1nsY27ssD/JmW4s83qmSb+uL6DG4GmCDzjmJB4xU
github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw=
github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM=
github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ=
github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY=
github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8=
github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk=
github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g=
github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand Down Expand Up @@ -481,8 +490,8 @@ github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/knadh/koanf v0.15.0 h1:HMm8cJZZIokMn5ETu9Exut1jQhfu1dm3b0TZedvhSVo=
github.com/knadh/koanf v0.15.0/go.mod h1:Ut3d4JaTRZYfO5a0wdYIGE+oyGaGFo4vXQ3ZvaSWxNc=
github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw=
github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -539,6 +548,8 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
Expand All @@ -548,10 +559,12 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo=
github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand All @@ -575,6 +588,7 @@ github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
Expand Down
18 changes: 9 additions & 9 deletions otes/dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ func TestNewEsFactory(t *testing.T) {
addrs := strings.Split(os.Getenv("ELASTICSEARCH_ADDR"), ",")
t.Run("normal construction", func(t *testing.T) {
esFactory, cleanup := provideEsFactory(&providersOption{})(factoryIn{
Conf: config.MapAdapter{"es": map[string]Config{
"default": {URL: addrs},
"alternative": {URL: addrs},
Conf: config.MapAdapter{"es": map[string]interface{}{
"default": map[string]interface{}{"url": addrs},
"alternative": map[string]interface{}{"url": addrs},
}},
Logger: log.NewNopLogger(),
Populator: Populator{},
Expand Down Expand Up @@ -86,9 +86,9 @@ func TestNewEsFactory(t *testing.T) {

t.Run("should not connect to ES", func(t *testing.T) {
esFactory, cleanup := provideEsFactory(&providersOption{})(factoryIn{
Conf: config.MapAdapter{"es": map[string]Config{
Conf: config.MapAdapter{"es": map[string]interface{}{
// elasticsearch server doesn't exist at this port
"default": {URL: []string{"http://127.0.0.1:9999"}},
"default": map[string]interface{}{"url": []string{"http://127.0.0.1:9999"}},
}},
Logger: log.NewNopLogger(),
Populator: Populator{},
Expand All @@ -102,9 +102,9 @@ func TestNewEsFactory(t *testing.T) {
t.Run("should not reload if the providersOption forbids", func(t *testing.T) {
dispatcher := &events.SyncDispatcher{}
esFactory, cleanup := provideEsFactory(&providersOption{})(factoryIn{
Conf: config.MapAdapter{"es": map[string]Config{
Conf: config.MapAdapter{"es": map[string]interface{}{
// elasticsearch server doesn't exist at this port
"default": {URL: []string{"http://127.0.0.1:9999"}},
"default": map[string]interface{}{"url": []string{"http://127.0.0.1:9999"}},
}},
Logger: log.NewNopLogger(),
Populator: Populator{},
Expand All @@ -125,9 +125,9 @@ func TestNewEsFactory(t *testing.T) {
t.Run("should reload if the providersOption allows", func(t *testing.T) {
dispatcher := &events.SyncDispatcher{}
esFactory, cleanup := provideEsFactory(&providersOption{reloadable: true})(factoryIn{
Conf: config.MapAdapter{"es": map[string]Config{
Conf: config.MapAdapter{"es": map[string]interface{}{
// elasticsearch server doesn't exist at this port
"default": {URL: []string{"http://127.0.0.1:9999"}},
"default": map[string]interface{}{"url": []string{"http://127.0.0.1:9999"}},
}},
Logger: log.NewNopLogger(),
Populator: Populator{},
Expand Down
14 changes: 7 additions & 7 deletions otgorm/dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ func TestProvideDBFactory(t *testing.T) {
t.Skip("set MYSQL_DSN to run TestProvideDBFactory")
return
}
gorms := map[string]databaseConf{
"default": {
Database: "sqlite",
Dsn: ":memory:",
gorms := map[string]interface{}{
"default": map[string]interface{}{
"database": "sqlite",
"dsn": ":memory:",
},
"alternative": {
Database: "mysql",
Dsn: os.Getenv("MYSQL_DSN"),
"alternative": map[string]interface{}{
"database": "mysql",
"dsn": os.Getenv("MYSQL_DSN"),
},
}

Expand Down
12 changes: 7 additions & 5 deletions otgorm/otgorm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ func TestHook(t *testing.T) {
},
drivers: map[string]func(dsn string) gorm.Dialector{"sqlite": sqlite.Open},
})(factoryIn{
Conf: config.MapAdapter{"gorm": map[string]databaseConf{
"default": {
Database: "sqlite",
Dsn: ":memory:",
Conf: config.MapAdapter{
"gorm": map[string]interface{}{
"default": map[string]interface{}{
"database": "sqlite",
"dsn": ":memory:",
},
},
}},
},
Logger: log.NewNopLogger(),
Tracer: tracer,
})
Expand Down
28 changes: 14 additions & 14 deletions otkafka/dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ func TestProvideReaderFactory(t *testing.T) {
}
addrs := strings.Split(os.Getenv("KAFKA_ADDR"), ",")
factory, cleanup := provideReaderFactory(factoryIn{
Conf: config.MapAdapter{"kafka.reader": map[string]ReaderConfig{
"default": {
Brokers: addrs,
Topic: "Test",
Conf: config.MapAdapter{"kafka.reader": map[string]interface{}{
"default": map[string]interface{}{
"brokers": addrs,
"topic": "Test",
},
"alternative": {
Brokers: addrs,
Topic: "Test",
"alternative": map[string]interface{}{
"brokers": addrs,
"topic": "Test",
},
}},
}, func(name string, reader *kafka.ReaderConfig) {})
Expand All @@ -54,14 +54,14 @@ func TestProvideWriterFactory(t *testing.T) {
addrs := strings.Split(os.Getenv("KAFKA_ADDR"), ",")
factory, cleanup := provideWriterFactory(factoryIn{
In: di.In{},
Conf: config.MapAdapter{"kafka.writer": map[string]WriterConfig{
"default": {
Brokers: addrs,
Topic: "Test",
Conf: config.MapAdapter{"kafka.writer": map[string]interface{}{
"default": map[string]interface{}{
"brokers": addrs,
"topic": "Test",
},
"alternative": {
Brokers: addrs,
Topic: "Test",
"alternative": map[string]interface{}{
"brokers": addrs,
"topic": "Test",
},
}},
}, func(name string, writer *kafka.Writer) {})
Expand Down
8 changes: 4 additions & 4 deletions otkafka/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ func TestTransport_RoundTrip(t *testing.T) {
factory, cleanup := provideWriterFactory(factoryIn{
Tracer: tracer,
In: di.In{},
Conf: config.MapAdapter{"kafka.writer": map[string]WriterConfig{
"default": {
Brokers: addrs,
Topic: "Test",
Conf: config.MapAdapter{"kafka.writer": map[string]interface{}{
"default": map[string]interface{}{
"brokers": addrs,
"topic": "Test",
},
}},
Logger: log.NewNopLogger(),
Expand Down

0 comments on commit be45e0d

Please sign in to comment.