Skip to content

Commit

Permalink
Prepare release 2.0.4
Browse files Browse the repository at this point in the history
Moved providers to public transport folder
  • Loading branch information
ilyashtrikul committed Nov 12, 2020
1 parent 496832c commit 8511189
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 38 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]


## [2.0.4] - 2020-11-12


## [2.0.3] - 2020-11-12


Expand All @@ -24,7 +27,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## 1.0.0 - 2020-09-28

[Unreleased]: https://github.com/vseinstrumentiru/lego/compare/v2.0.3...HEAD
[Unreleased]: https://github.com/vseinstrumentiru/lego/compare/v2.0.4...HEAD
[2.0.4]: https://github.com/vseinstrumentiru/lego/compare/v2.0.3...v2.0.4
[2.0.3]: https://github.com/vseinstrumentiru/lego/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/vseinstrumentiru/lego/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/vseinstrumentiru/lego/compare/v2.0.0...v2.0.1
Expand Down
38 changes: 19 additions & 19 deletions server/providers.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package server

import (
"github.com/vseinstrumentiru/lego/v2/internal/events"
"github.com/vseinstrumentiru/lego/v2/internal/events/eventrouter"
"github.com/vseinstrumentiru/lego/v2/internal/metrics"
"github.com/vseinstrumentiru/lego/v2/internal/metrics/exporters/newrelicexporter"
"github.com/vseinstrumentiru/lego/v2/internal/metrics/propagation"
grpcProvider "github.com/vseinstrumentiru/lego/v2/internal/transpoort/grpc"
"github.com/vseinstrumentiru/lego/v2/internal/transpoort/http/httpclient"
"github.com/vseinstrumentiru/lego/v2/internal/transpoort/http/httpserver"
"github.com/vseinstrumentiru/lego/v2/internal/transpoort/mysql"
"github.com/vseinstrumentiru/lego/v2/internal/transpoort/nats"
"github.com/vseinstrumentiru/lego/v2/internal/transpoort/sql"
"github.com/vseinstrumentiru/lego/v2/internal/transpoort/stan"
events2 "github.com/vseinstrumentiru/lego/v2/transport/events"
eventrouter2 "github.com/vseinstrumentiru/lego/v2/transport/events/eventrouter"
"github.com/vseinstrumentiru/lego/v2/transport/grpc"
"github.com/vseinstrumentiru/lego/v2/transport/http/httpclient"
"github.com/vseinstrumentiru/lego/v2/transport/http/httpserver"
mysql2 "github.com/vseinstrumentiru/lego/v2/transport/mysql"
nats2 "github.com/vseinstrumentiru/lego/v2/transport/nats"
"github.com/vseinstrumentiru/lego/v2/transport/sql"
stan2 "github.com/vseinstrumentiru/lego/v2/transport/stan"
)

func providers() []interface{} {
Expand All @@ -25,18 +25,18 @@ func providers() []interface{} {
httpserver.Provide,
httpclient.Provide,
httpclient.ConstructorProvider,
grpcProvider.Provide,
grpc.Provide,
// database
mysql.Provide,
mysql2.Provide,
sql.Provide,
// events
nats.Provide,
stan.Provide,
eventrouter.Provide,
events.ProvideKafkaPublisher,
events.ProvideKafkaSubscriber,
events.ProvideNatsSubscriber,
events.ProvideNatsPublisher,
events.ProvideChannel,
nats2.Provide,
stan2.Provide,
eventrouter2.Provide,
events2.ProvideKafkaPublisher,
events2.ProvideKafkaSubscriber,
events2.ProvideNatsSubscriber,
events2.ProvideNatsPublisher,
events2.ProvideChannel,
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package http
package grpc

import (
"fmt"
Expand All @@ -16,14 +16,13 @@ import (
"github.com/vseinstrumentiru/lego/v2/internal/metrics/propagation"
"github.com/vseinstrumentiru/lego/v2/metrics/tracing"
"github.com/vseinstrumentiru/lego/v2/multilog"
grpccfg "github.com/vseinstrumentiru/lego/v2/transport/grpc"
"github.com/vseinstrumentiru/lego/v2/transport/http/middleware"
"github.com/vseinstrumentiru/lego/v2/version"
)

type args struct {
dig.In
Config *grpccfg.Config `optional:"true"`
Config *Config `optional:"true"`
TraceTags middleware.TraceTagsMiddlewareConfig `optional:"true"`
TraceConfig *tracing.Config `optional:"true"`

Expand All @@ -37,7 +36,7 @@ type args struct {

func Provide(in args) *grpc.Server {
if in.Config == nil {
in.Config = grpccfg.NewDefaultConfig()
in.Config = NewDefaultConfig()
}

logger := in.Logger.WithFields(map[string]interface{}{"component": "grpc"})
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database
package mysql

import "database/sql/driver"

type MySQLConnector struct {
type Connector struct {
driver.Connector
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ import (
"logur.dev/logur"

"github.com/vseinstrumentiru/lego/v2/multilog"
"github.com/vseinstrumentiru/lego/v2/transport/database"
lemysql "github.com/vseinstrumentiru/lego/v2/transport/mysql"
)

type args struct {
dig.In
Config *lemysql.Config
Config *Config
Logger multilog.Logger
}

func Provide(in args) (*database.MySQLConnector, error) {
func Provide(in args) (*Connector, error) {
connector, err := mysql.NewConnector(&in.Config.Config)

if err != nil {
Expand All @@ -28,7 +26,7 @@ func Provide(in args) (*database.MySQLConnector, error) {
logger := in.Logger.WithFields(map[string]interface{}{"component": "mysql"})
_ = mysql.SetLogger(logur.NewErrorPrintLogger(logger))

return &database.MySQLConnector{
return &Connector{
Connector: ocsql.WrapConnector(
connector,
ocsql.WithOptions(in.Config.Trace),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"github.com/nats-io/nats.go"
"go.uber.org/dig"

lenats "github.com/vseinstrumentiru/lego/v2/transport/nats"
lestan "github.com/vseinstrumentiru/lego/v2/transport/stan"
)

type args struct {
dig.In
Config *lenats.Config
Config *Config
StanConfig *lestan.Config `optional:"true"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"go.uber.org/dig"

"github.com/vseinstrumentiru/lego/v2/server/shutdown"
"github.com/vseinstrumentiru/lego/v2/transport/database"
"github.com/vseinstrumentiru/lego/v2/transport/mysql"
)

type args struct {
dig.In
MySQL *database.MySQLConnector `optional:"true"`
MySQL *mysql.Connector `optional:"true"`

Closer *shutdown.CloseGroup
Health health.Health
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import (
"github.com/nats-io/nats.go"
"github.com/nats-io/stan.go"
"go.uber.org/dig"

lestan "github.com/vseinstrumentiru/lego/v2/transport/stan"
)

type args struct {
dig.In
Stan *lestan.Config
Stan *Config
Nats *nats.Conn
}

Expand Down

0 comments on commit 8511189

Please sign in to comment.