mirror of
https://github.com/muun/recovery.git
synced 2025-11-13 07:11:45 -05:00
Release v2.2.0
This commit is contained in:
37
vendor/github.com/fiatjaf/go-lnurl/base.go
generated
vendored
Normal file
37
vendor/github.com/fiatjaf/go-lnurl/base.go
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package lnurl
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// The base response for all lnurl calls.
|
||||
type LNURLResponse struct {
|
||||
Status string `json:"status,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
type LNURLErrorResponse struct {
|
||||
Status string `json:"status,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
URL *url.URL `json:"-"`
|
||||
}
|
||||
|
||||
func (r LNURLErrorResponse) Error() string {
|
||||
return r.Reason
|
||||
}
|
||||
|
||||
func OkResponse() LNURLResponse {
|
||||
return LNURLResponse{Status: "OK"}
|
||||
}
|
||||
|
||||
func ErrorResponse(reason string) LNURLErrorResponse {
|
||||
return LNURLErrorResponse{
|
||||
URL: nil,
|
||||
Status: "ERROR",
|
||||
Reason: reason,
|
||||
}
|
||||
}
|
||||
|
||||
type LNURLParams interface {
|
||||
LNURLKind() string
|
||||
}
|
||||
Reference in New Issue
Block a user