Add Service Status page with service_health_check and report_issue examples

This commit is contained in:
Ross Savage
2023-11-27 13:50:16 +01:00
parent b65d2c0d85
commit 2e24d376ee
11 changed files with 348 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package example
import (
"log"
"github.com/breez/breez-sdk-go/breez_sdk"
)
func HealthCheckStatus() {
// ANCHOR: health-check-status
if healthCheck, err := sdk.ServiceHealthCheck(); err != nil {
log.Printf("Current service status is: %v", healthCheck.Status)
}
// ANCHOR_END: health-check-status
}
func ReportPaymentFailure() {
// ANCHOR: report-payment-failure
paymentHash := "..."
reportIssueRequest := breez_sdk.ReportIssueRequestPaymentFailure{
Data: breez_sdk.ReportPaymentFailureDetails{
PaymentHash: paymentHash,
},
}
if err := sdk.ReportIssue(reportIssueRequest); err != nil {
log.Printf("%#v", err)
}
// ANCHOR_END: report-payment-failure
}