Skip to content

Commit

Permalink
Prepare release 2.0.5
Browse files Browse the repository at this point in the history
Fixed providers args visibility
  • Loading branch information
ilyashtrikul committed Nov 12, 2020
1 parent 8511189 commit 09c807e
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 26 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.5] - 2020-11-12


## [2.0.4] - 2020-11-12


Expand All @@ -27,7 +30,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.4...HEAD
[Unreleased]: https://github.com/vseinstrumentiru/lego/compare/v2.0.5...HEAD
[2.0.5]: https://github.com/vseinstrumentiru/lego/compare/v2.0.4...v2.0.5
[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
Expand Down
4 changes: 2 additions & 2 deletions transport/events/channelprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"github.com/vseinstrumentiru/lego/v2/multilog"
)

type channelArgs struct {
type ChannelArgs struct {
dig.In
Config *gochannel.Config `optional:"true"`
Logger multilog.Logger
}

func ProvideChannel(in channelArgs) (*gochannel.GoChannel, error) {
func ProvideChannel(in ChannelArgs) (*gochannel.GoChannel, error) {
cfg := gochannel.Config{}

if in.Config != nil {
Expand Down
2 changes: 1 addition & 1 deletion transport/events/channelprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func TestPubSub(t *testing.T) {
ass := assert.New(t)

c, err := ProvideChannel(channelArgs{
c, err := ProvideChannel(ChannelArgs{
Logger: multilog.New(0),
})
ass.NoError(err)
Expand Down
4 changes: 2 additions & 2 deletions transport/events/eventrouter/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
"github.com/vseinstrumentiru/lego/v2/multilog"
)

type args struct {
type Args struct {
dig.In
RouterConfig *events.RouterConfig `optional:"true"`
Logger multilog.Logger
Pipeline *run.Group
}

func Provide(in args) (*message.Router, error) {
func Provide(in Args) (*message.Router, error) {
cfg := message.RouterConfig{}
logger := in.Logger.WithFields(map[string]interface{}{"component": "events.router"})

Expand Down
8 changes: 4 additions & 4 deletions transport/events/kafkaprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ import (
kafkatransport "github.com/vseinstrumentiru/lego/v2/transport/kafka"
)

type kafkaPubArgs struct {
type KafkaPubArgs struct {
dig.In
Broker *kafkatransport.Config
Logger multilog.Logger
Encoder kafka.Marshaler
}

type kafkaSubArgs struct {
type KafkaSubArgs struct {
dig.In
Broker *kafkatransport.Config
Logger multilog.Logger
Decoder kafka.Unmarshaler
}

func ProvideKafkaPublisher(in kafkaPubArgs) (*kafka.Publisher, error) {
func ProvideKafkaPublisher(in KafkaPubArgs) (*kafka.Publisher, error) {
pub, err := kafka.NewPublisher(
in.Broker.Addr,
in.Encoder,
Expand All @@ -34,7 +34,7 @@ func ProvideKafkaPublisher(in kafkaPubArgs) (*kafka.Publisher, error) {
return pub.(*kafka.Publisher), err
}

func ProvideKafkaSubscriber(in kafkaSubArgs) (*kafka.Subscriber, error) {
func ProvideKafkaSubscriber(in KafkaSubArgs) (*kafka.Subscriber, error) {
subCfg := kafka.SubscriberConfig{
Brokers: in.Broker.Addr,
ConsumerGroup: in.Broker.GroupName,
Expand Down
8 changes: 4 additions & 4 deletions transport/events/natsprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ import (
lestan "github.com/vseinstrumentiru/lego/v2/transport/stan"
)

type natsPubArgs struct {
type NatsPubArgs struct {
dig.In
Stan stan.Conn
Logger multilog.Logger
Encoder nats.Marshaler
}

type natsSubArgs struct {
type NatsSubArgs struct {
dig.In
Config *lestan.Config
Stan stan.Conn
Logger multilog.Logger
Decoder nats.Unmarshaler
}

func ProvideNatsPublisher(in natsPubArgs) (*nats.StreamingPublisher, error) {
func ProvideNatsPublisher(in NatsPubArgs) (*nats.StreamingPublisher, error) {
return nats.NewStreamingPublisherWithStanConn(
in.Stan,
nats.StreamingPublisherPublishConfig{
Expand All @@ -35,7 +35,7 @@ func ProvideNatsPublisher(in natsPubArgs) (*nats.StreamingPublisher, error) {
)
}

func ProvideNatsSubscriber(in natsSubArgs) (*nats.StreamingSubscriber, error) {
func ProvideNatsSubscriber(in NatsSubArgs) (*nats.StreamingSubscriber, error) {
subCfg := nats.StreamingSubscriberSubscriptionConfig{
DurableName: in.Config.DurableName,
QueueGroup: in.Config.GroupName,
Expand Down
4 changes: 2 additions & 2 deletions transport/grpc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/vseinstrumentiru/lego/v2/version"
)

type args struct {
type Args struct {
dig.In
Config *Config `optional:"true"`
TraceTags middleware.TraceTagsMiddlewareConfig `optional:"true"`
Expand All @@ -34,7 +34,7 @@ type args struct {
Upg *tableflip.Upgrader
}

func Provide(in args) *grpc.Server {
func Provide(in Args) *grpc.Server {
if in.Config == nil {
in.Config = NewDefaultConfig()
}
Expand Down
4 changes: 2 additions & 2 deletions transport/http/httpserver/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/vseinstrumentiru/lego/v2/version"
)

type args struct {
type Args struct {
dig.In
Config *httpcfg.Config `optional:"true"`
TraceTags middleware.TraceTagsMiddlewareConfig `optional:"true"`
Expand All @@ -40,7 +40,7 @@ type args struct {
Upg *tableflip.Upgrader
}

func Provide(in args) (*http.Server, *mux.Router) {
func Provide(in Args) (*http.Server, *mux.Router) {
if in.Config == nil {
in.Config = httpcfg.NewDefaultConfig()
}
Expand Down
4 changes: 2 additions & 2 deletions transport/mysql/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"github.com/vseinstrumentiru/lego/v2/multilog"
)

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

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

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions transport/nats/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
lestan "github.com/vseinstrumentiru/lego/v2/transport/stan"
)

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

func Provide(in args) (*nats.Conn, error) {
func Provide(in Args) (*nats.Conn, error) {
if in.Config == nil {
return nil, errors.New("nats config not found")
}
Expand Down
4 changes: 2 additions & 2 deletions transport/sql/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import (
"github.com/vseinstrumentiru/lego/v2/transport/mysql"
)

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

Closer *shutdown.CloseGroup
Health health.Health
}

func Provide(in args) (*sql.DB, error) {
func Provide(in Args) (*sql.DB, error) {
var connector driver.Connector

if in.MySQL != nil {
Expand Down
4 changes: 2 additions & 2 deletions transport/stan/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"go.uber.org/dig"
)

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

func Provide(in args) (stan.Conn, error) {
func Provide(in Args) (stan.Conn, error) {
if in.Stan == nil {
return nil, errors.New("stan config not found")
}
Expand Down

0 comments on commit 09c807e

Please sign in to comment.