mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Add Go snippets
This commit is contained in:
committed by
Erdem Yerebasmaz
parent
f65bcc1653
commit
dc64895b65
27
snippets/go/connecting_lsp.go
Normal file
27
snippets/go/connecting_lsp.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"log"
|
||||
)
|
||||
|
||||
func GetLspInfo() {
|
||||
// ANCHOR: get-lsp-info
|
||||
if lspId, err := sdk.LspId(); lspId != nil && err == nil {
|
||||
log.Printf("%#v", *lspId)
|
||||
}
|
||||
|
||||
if lspInfo, err := sdk.LspInfo(); err == nil {
|
||||
log.Printf("%#v", lspInfo)
|
||||
}
|
||||
// ANCHOR_END: get-lsp-info
|
||||
}
|
||||
|
||||
func ConnectLsp() {
|
||||
// ANCHOR: connect-lsp
|
||||
lspId := "your selected lsp id"
|
||||
|
||||
if err := sdk.ConnectLsp(lspId); err != nil {
|
||||
log.Printf("%#v", err)
|
||||
}
|
||||
// ANCHOR_END: connect-lsp
|
||||
}
|
||||
Reference in New Issue
Block a user