File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,17 @@ type HealthChecker struct {
1111 Service string
1212}
1313
14- func NewHealthChecker (client * sqs.SQS , queueName string ) * HealthChecker {
15- return NewSQSHealthChecker (client , queueName , "sqs" )
14+ func NewHealthChecker (client * sqs.SQS , queueName string , options ... string ) * HealthChecker {
15+ var name string
16+ if len (options ) > 0 && len (options [0 ]) > 0 {
17+ name = options [0 ]
18+ } else {
19+ name = "sqs"
20+ }
21+ return NewSQSHealthChecker (client , name , queueName )
1622}
1723func NewSQSHealthChecker (client * sqs.SQS , name string , queueName string ) * HealthChecker {
18- return & HealthChecker {client , & queueName , name }
24+ return & HealthChecker {Client : client , QueueName : & queueName , Service : name }
1925}
2026
2127func (h * HealthChecker ) Name () string {
You can’t perform that action at this time.
0 commit comments