gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taldir] 01/02: minor refactoring


From: gnunet
Subject: [taler-taldir] 01/02: minor refactoring
Date: Mon, 18 Jul 2022 12:55:23 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository taldir.

commit 07b4475b461fcecec37da5d5878479660167b59f
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Mon Jul 18 12:48:07 2022 +0200

    minor refactoring
---
 cmd/taldir-server/main.go | 10 +++++++++-
 pkg/rest/taldir.go        | 13 -------------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/cmd/taldir-server/main.go b/cmd/taldir-server/main.go
index 205a7e6..6f0b400 100644
--- a/cmd/taldir-server/main.go
+++ b/cmd/taldir-server/main.go
@@ -29,9 +29,17 @@ package main
 
 import (
   "flag"
+  "net/http"
+  "log"
   "taler.net/taldir/pkg/rest"
 )
 
+var t taldir.Taldir
+
+func handleRequests() {
+  
log.Fatal(http.ListenAndServe(t.Cfg.Section("taldir").Key("bind_to").MustString("localhost:11000"),
 t.Router))
+}
+
 func main() {
   var cfgFlag = flag.String("c", "", "Configuration file to use")
 
@@ -42,5 +50,5 @@ func main() {
   }
   t := taldir.Taldir{}
   t.Initialize(cfgfile)
-  t.Run()
+  handleRequests()
 }
diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go
index 5ede30f..160d1d8 100644
--- a/pkg/rest/taldir.go
+++ b/pkg/rest/taldir.go
@@ -19,11 +19,8 @@
 package taldir
 
 /* TODO
- - ToS API (terms, privacy) with localizions
  - ToS compression
  - ToS etag
- - Maintenance of database: When to delete expired validations?
-   Currently, we expire on startup 1 day old validations
 */
 
 import (
@@ -707,10 +704,6 @@ func (t *Taldir) setupHandlers() {
 
 }
 
-func (t *Taldir) handleRequests() {
-  
log.Fatal(http.ListenAndServe(t.Cfg.Section("taldir").Key("bind_to").MustString("localhost:11000"),
 t.Router))
-}
-
 // Initialize the Taldir instance with cfgfile
 func (t *Taldir) Initialize(cfgfile string) {
   _cfg, err := ini.Load(cfgfile)
@@ -791,9 +784,3 @@ func (t *Taldir) Initialize(cfgfile string) {
   t.Merchant = taler.NewMerchant(merchURL, merchToken)
   t.setupHandlers()
 }
-
-
-// Run the server and listen for requests
-func (t *Taldir) Run() {
-  t.handleRequests()
-}

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]