Skip to content

Commit

Permalink
fix: Fix some issues caused by merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kianaza committed May 20, 2024
1 parent 044abe4 commit ad77fbd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const (
type (
// Config holds all configurations.
Config struct {
Logger logger.Config `json:"logger,omitempty" koanf:"logger"`
NATS client.Config `json:"nats,omitempty" koanf:"nats"`
Metric metric.Config `json:"metric,omitempty" koanf:"metric"`
Logger logger.Config `json:"logger,omitempty" koanf:"logger"`
NATS natsclient.Config `json:"nats,omitempty" koanf:"nats"`
Metric metric.Config `json:"metric,omitempty" koanf:"metric"`
}
)

Expand Down
23 changes: 9 additions & 14 deletions internal/natsclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ type NatsClient struct {
Metrics Metrics
}

func New(logger *zap.Logger, cfg Config) *Client {
func New(logger *zap.Logger, cfg Config) *NatsClient {
nc := connect(logger, cfg)

metrics := NewMetrics()

client := &Client{
client := &NatsClient{
Conn: nc,
Logger: logger,
Config: cfg,
Expand Down Expand Up @@ -56,18 +56,13 @@ func (c *NatsClient) StartMessaging() {
go c.Publish("")
}

func New(nc *nats.Conn, logger *zap.Logger, cfg Config) *NatsClient {
return &NatsClient{
Conn: nc,
Logger: logger,
Config: cfg,
}
}

func (c *NatsClient) StartMessaging() {
go c.Subscribe("")
go c.Publish("")
}
// func New(nc *nats.Conn, logger *zap.Logger, cfg Config) *NatsClient {
// return &NatsClient{
// Conn: nc,
// Logger: logger,
// Config: cfg,
// }
// }

func (c *NatsClient) Publish(subject string) {
if subject == "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/natsclient/metric.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package client
package natsclient

import (
"errors"
Expand Down

0 comments on commit ad77fbd

Please sign in to comment.