mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-04-10 20:59:24 +02:00
nip46: implement fmt.Stringer for request and response.
This commit is contained in:
parent
e05dbb5d51
commit
022d4ce598
@ -19,12 +19,22 @@ type Request struct {
|
||||
Params []string `json:"params"`
|
||||
}
|
||||
|
||||
func (r Request) String() string {
|
||||
j, _ := json.Marshal(r)
|
||||
return string(j)
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
ID string `json:"id"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Result string `json:"result,omitempty"`
|
||||
}
|
||||
|
||||
func (r Response) String() string {
|
||||
j, _ := json.Marshal(r)
|
||||
return string(j)
|
||||
}
|
||||
|
||||
type Signer interface {
|
||||
GetSession(clientPubkey string) (Session, bool)
|
||||
HandleRequest(context.Context, *nostr.Event) (req Request, resp Response, eventResponse nostr.Event, err error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user