From 042e70f00894351830963ad1974eae603d13c312 Mon Sep 17 00:00:00 2001 From: Restu Muzakir Date: Tue, 23 Nov 2021 23:04:09 +0700 Subject: [PATCH] feat: update data type for amqp client --- amqp/amqp.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/amqp/amqp.go b/amqp/amqp.go index 68b9240..4f31a04 100644 --- a/amqp/amqp.go +++ b/amqp/amqp.go @@ -17,7 +17,7 @@ type Config struct { Password string } -type amqpClient struct { +type AmqpClient struct { Connection *amqp.Connection ServiceName string } @@ -27,7 +27,7 @@ func SetUri(config Config) string { } // Open Connection to AMQP Server -func NewClient(config Config) (*amqpClient, error) { +func NewClient(config Config) (*AmqpClient, error) { uri := SetUri(config) amqpConn, err := amqp.Dial(uri) @@ -35,10 +35,10 @@ func NewClient(config Config) (*amqpClient, error) { return nil, err } - return &amqpClient{Connection: amqpConn, ServiceName: config.ServiceName}, nil + return &AmqpClient{Connection: amqpConn, ServiceName: config.ServiceName}, nil } -func (a *amqpClient) AddPublisher(publisher *publisher.PublisherConfig) { +func (a *AmqpClient) AddPublisher(publisher *publisher.PublisherConfig) { channel, err := a.Connection.Channel() if err != nil { log.Println(err.Error()) @@ -62,7 +62,7 @@ func (a *amqpClient) AddPublisher(publisher *publisher.PublisherConfig) { log.Println(fmt.Sprintf(`Exchange: %s created`, publisher.TopicName)) } -func (a *amqpClient) AddSubscriber(subscriber *subscriber.SubscriberConfig) { +func (a *AmqpClient) AddSubscriber(subscriber *subscriber.SubscriberConfig) { channel, err := a.Connection.Channel() if err != nil { log.Println(err.Error())