-
Notifications
You must be signed in to change notification settings - Fork 87
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: Frank Jogeleit <frank.jogeleit@lovoo.com>
- Loading branch information
Frank Jogeleit
committed
May 9, 2024
1 parent
c54286b
commit 169a068
Showing
6 changed files
with
135 additions
and
92 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
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,24 @@ | ||
package slack | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/slack-go/slack" | ||
) | ||
|
||
type APIClient interface { | ||
PostMessage(*slack.WebhookMessage) error | ||
} | ||
|
||
type apiClient struct { | ||
webhook string | ||
client *http.Client | ||
} | ||
|
||
func (c *apiClient) PostMessage(message *slack.WebhookMessage) error { | ||
return slack.PostWebhookCustomHTTP(c.webhook, c.client, message) | ||
} | ||
|
||
func NewAPIClient(webhook string, client *http.Client) APIClient { | ||
return &apiClient{webhook: webhook, client: client} | ||
} |
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
Oops, something went wrong.