generated from mrz1836/go-template
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(SPV-930): get all webhooks - endpoint for admin (#671)
- Loading branch information
1 parent
42f706f
commit 691f3c5
Showing
8 changed files
with
76 additions
and
1 deletion.
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
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,18 @@ | ||
package mappings | ||
|
||
import ( | ||
"github.com/bitcoin-sv/spv-wallet/engine/notifications" | ||
"github.com/bitcoin-sv/spv-wallet/models" | ||
) | ||
|
||
// MapToWebhookContract will map the webhook model from spv-wallet engine to the spv-wallet-models contract | ||
func MapToWebhookContract(w notifications.ModelWebhook) *models.Webhook { | ||
if w == nil { | ||
return nil | ||
} | ||
|
||
return &models.Webhook{ | ||
URL: w.GetURL(), | ||
Banned: w.Banned(), | ||
} | ||
} |
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,8 @@ | ||
package models | ||
|
||
// Webhook is a webhook model | ||
// TokenHeader and TokenValue are not exposed because of security reasons | ||
type Webhook struct { | ||
URL string `json:"url"` | ||
Banned bool `json:"banned"` | ||
} |