reformat with gofmt

This commit is contained in:
Peter Rounce 2023-01-29 10:33:34 +00:00
parent d82c17e0a1
commit 7816566d59
9 changed files with 221 additions and 216 deletions

26
main.go
View file

@ -1,8 +1,8 @@
package main
import (
log "github.com/sirupsen/logrus"
"github.com/gorilla/mux"
log "github.com/sirupsen/logrus"
"net/http"
"time"
)
@ -27,26 +27,26 @@ func main() {
log_level := db_get_setting("LOG_LEVEL")
switch log_level {
case "DEBUG":
log.SetLevel(log.DebugLevel)
log.Info("bolt card service started - debug log level")
case "PRODUCTION":
log.Info("bolt card service started - production log level")
default:
// log.Fatal calls os.Exit(1) after logging the error
log.Fatal("error getting a valid LOG_LEVEL setting from the database")
case "DEBUG":
log.SetLevel(log.DebugLevel)
log.Info("bolt card service started - debug log level")
case "PRODUCTION":
log.Info("bolt card service started - production log level")
default:
// log.Fatal calls os.Exit(1) after logging the error
log.Fatal("error getting a valid LOG_LEVEL setting from the database")
}
log.SetFormatter(&log.JSONFormatter{
DisableHTMLEscape: true,
})
// createboltcard
// createboltcard
router.Path("/new").Methods("GET").HandlerFunc(new_card_request)
// lnurlw for pos
// lnurlw for pos
router.Path("/ln").Methods("GET").HandlerFunc(lnurlw_response)
router.Path("/cb").Methods("GET").HandlerFunc(lnurlw_callback)
// lnurlp for lightning address
// lnurlp for lightning address
router.Path("/.well-known/lnurlp/{name}").Methods("GET").HandlerFunc(lnurlp_response)
router.Path("/lnurlp/{name}").Methods("GET").HandlerFunc(lnurlp_callback)
@ -55,7 +55,7 @@ func main() {
port = "9000"
}
srv := &http.Server {
srv := &http.Server{
Handler: router,
Addr: ":" + port, // consider adding host
WriteTimeout: 30 * time.Second,