[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taldir] branch master updated: -remove some nonsense comments
From: |
gnunet |
Subject: |
[taler-taldir] branch master updated: -remove some nonsense comments |
Date: |
Sun, 17 Apr 2022 19:27:31 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository taldir.
The following commit(s) were added to refs/heads/master by this push:
new a591354 -remove some nonsense comments
a591354 is described below
commit a59135486b3ddb147744d7fd679fba41dd1a927b
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Sun Apr 17 19:27:19 2022 +0200
-remove some nonsense comments
---
taldir.go | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/taldir.go b/taldir.go
index c2227d7..2da283e 100644
--- a/taldir.go
+++ b/taldir.go
@@ -41,9 +41,6 @@ type Validation struct {
}
-// let's declare a global Articles array
-// that we can then populate in our main function
-// to simulate a database
var Entries []Entry
var db *gorm.DB
@@ -57,14 +54,11 @@ func sendEmail(recipient string, ref Validation) {
recipient,
}
- // smtp server configuration.
smtpHost := "localhost"
smtpPort := "587"
- // Message.
message := []byte("Please click here to validate your Taldir identity: " +
ref.ValidationReference)
- // Sending email.
err := smtp.SendMail(smtpHost+":"+smtpPort, nil, from, to, message)
if err != nil {
fmt.Println(err)
@@ -75,9 +69,6 @@ func sendEmail(recipient string, ref Validation) {
func returnSingleEntry(w http.ResponseWriter, r *http.Request){
vars := mux.Vars(r)
- // Loop over all of our Articles
- // if the article.Id equals the key we pass in
- // return the article encoded as JSON
var entry Entry
var err = db.First(&entry, "identity_key = ?", vars["identity_key"]).Error
if err == nil {
@@ -117,9 +108,6 @@ func generateToken() string {
}
func addSingleEntry(w http.ResponseWriter, r *http.Request){
- // Loop over all of our Articles
- // if the article.Id equals the key we pass in
- // return the article encoded as JSON
var entry Entry
if r.Body == nil {
http.Error(w, "No request body", 400)
@@ -153,18 +141,11 @@ func addSingleEntry(w http.ResponseWriter, r
*http.Request){
json.NewEncoder(w).Encode(entry)
}
-
-
func handleRequests() {
- // creates a new instance of a mux router
myRouter := mux.NewRouter().StrictSlash(true)
- // replace http.HandleFunc with myRouter.HandleFunc
myRouter.HandleFunc("/directory/{id}", returnSingleEntry).Methods("GET")
myRouter.HandleFunc("/validation/{reference}",
validateSingleEntry).Methods("POST")
myRouter.HandleFunc("/directory/", addSingleEntry).Methods("POST")
- // finally, instead of passing in nil, we want
- // to pass in our newly created router as the second
- // argument
log.Fatal(http.ListenAndServe(":10000", myRouter))
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taldir] branch master updated: -remove some nonsense comments,
gnunet <=