generated from nano-interactive/go-library-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dusan Malusev <dusan@dusanmalusev.dev>
- Loading branch information
1 parent
a45e393
commit 6e11ac5
Showing
21 changed files
with
299 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
package connection | ||
|
||
import "fmt" | ||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
var ( | ||
ErrOnConnectionReady = errors.New("onConnectionReady is required") | ||
ErrRetriesExhausted = errors.New("number of retries to acquire connection exhausted") | ||
) | ||
|
||
type OnBeforeConnectError struct { | ||
inner error | ||
Inner error | ||
} | ||
|
||
type ConnectInitError struct { | ||
inner error | ||
Inner error | ||
} | ||
|
||
type OnConnectionCloseError struct { | ||
inner error | ||
Inner error | ||
} | ||
|
||
func (e OnBeforeConnectError) Error() string { | ||
return fmt.Sprintf("non library error before reconnecting: %v", e.inner) | ||
return fmt.Sprintf("non library error before reconnecting: %v", e.Inner) | ||
} | ||
|
||
func (e ConnectInitError) Error() string { | ||
return fmt.Sprintf("non library error after reconnect: %v", e.inner) | ||
return fmt.Sprintf("non library error after reconnect: %v", e.Inner) | ||
} | ||
|
||
func (e OnConnectionCloseError) Error() string { | ||
return fmt.Sprintf("error on closing previous connection: %v", e.inner) | ||
return fmt.Sprintf("error on closing previous connection: %v", e.Inner) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package consumer | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
var ( | ||
ErrQueueNameRequired = errors.New("queue name is required... Please call WithQueueName(queueName) option function") | ||
ErrOnMessageCallbackRequired = errors.New("onMessageError is required") | ||
ErrMessageTypeInvalid = errors.New("message type must be a value type") | ||
) | ||
|
||
type ( | ||
QueueDeclarationError struct{ Inner error } | ||
ListenerStartFailedError struct{ Inner error } | ||
) | ||
|
||
func (e *QueueDeclarationError) Error() string { | ||
return fmt.Sprintf("queue declaration error: %v", e.Inner) | ||
} | ||
|
||
func (e *ListenerStartFailedError) Error() string { | ||
return fmt.Sprintf("failed to start listener: %v", e.Inner) | ||
} |
Oops, something went wrong.