Skip to content
Snippets Groups Projects
Commit 388ff05f authored by Flnal's avatar Flnal
Browse files

added files

parent be3f8991
No related branches found
No related tags found
1 merge request!3Master
go.mod 0 → 100644
package main
import (
"log"
"net/http"
"github.com/gorilla/mux"
"gitlab.reutlingen-university.de/albrecht/myaktion-go/src/myaktion/handler"
)
//"gitlab.reutlingen-university.de/albrecht/myaktion-go/src/myaktion/model"
func main() {
log.Println("Starting My-Aktion API server")
router := mux.NewRouter()
router.HandleFunc("/health", handler.Health).Methods("GET")
if err := http.ListenAndServe(":8000", router); err != nil {
log.Fatal(err)
}
}
package handler
import (
"io"
"net/http"
)
func Health(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
io.WriteString(w, `{"alive": true}`)
}
package main
import "fmt"
func main() {
fmt.Println("test")
}
package model
type Account struct {
Name string
BankName string
Number string
}
package model
type Camaign struct {
Name string
OrganizerName string
TargetAmount float64
DonationMinimum float64
AmountDonatedSoFar float64
Donations []Donation
Account Account
}
package model
type Donation struct {
Amount float64
DonorName string
ReceiptRequested bool
Account Account
Status Status
}
type Status string
const (
Transferred Status = "Transferred"
In_Process Status = "In_Process"
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment