This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
functions.go
120 lines (98 loc) · 3.76 KB
/
functions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package functions
import (
"context"
"github.com/covid19cz/erouska-backend/internal/functions/changepushtoken"
"github.com/covid19cz/erouska-backend/internal/functions/coviddata"
"github.com/covid19cz/erouska-backend/internal/functions/efgs"
"github.com/covid19cz/erouska-backend/internal/functions/isehridactive"
"github.com/covid19cz/erouska-backend/internal/functions/metricsapi"
"github.com/covid19cz/erouska-backend/internal/functions/publishkeys"
"github.com/covid19cz/erouska-backend/internal/functions/registerehrid"
"github.com/covid19cz/erouska-backend/internal/functions/registernotification"
"github.com/covid19cz/erouska-backend/internal/functions/wakeup"
"github.com/covid19cz/erouska-backend/internal/pubsub"
"net/http"
)
// RegisterEhrid Registration handler.
func RegisterEhrid(w http.ResponseWriter, r *http.Request) {
registerehrid.RegisterEhrid(w, r)
}
// IsEhridActive IsEhridActive handler.
func IsEhridActive(w http.ResponseWriter, r *http.Request) {
isehridactive.IsEhridActive(w, r)
}
// ChangePushToken ChangePushToken handler.
func ChangePushToken(w http.ResponseWriter, r *http.Request) {
changepushtoken.ChangePushToken(w, r)
}
// RegisterNotification RegisterNotification handler.
func RegisterNotification(w http.ResponseWriter, r *http.Request) {
registernotification.RegisterNotification(w, r)
}
// RegisterNotificationAfterMath RegisterNotificationAfterMath handler.
func RegisterNotificationAfterMath(ctx context.Context, m pubsub.Message) error {
return registernotification.AfterMath(ctx, m)
}
// DownloadCovidDataTotal handler.
func DownloadCovidDataTotal(w http.ResponseWriter, r *http.Request) {
coviddata.DownloadCovidDataTotal(w, r)
}
// DownloadAndCountVaccinations handler.
func DownloadAndCountVaccinations(w http.ResponseWriter, r *http.Request) {
coviddata.DownloadAndCountVaccinations(w, r)
}
// GetCovidData handler.
func GetCovidData(w http.ResponseWriter, r *http.Request) {
coviddata.GetCovidData(w, r)
}
//PrepareNewMetricsVersion handler.
func PrepareNewMetricsVersion(w http.ResponseWriter, r *http.Request) {
metricsapi.PrepareNewVersion(w, r)
}
//DownloadMetrics handler.
func DownloadMetrics(w http.ResponseWriter, r *http.Request) {
metricsapi.DownloadMetrics(w, r)
}
//RegisterEhridAfterMath handler.
func RegisterEhridAfterMath(ctx context.Context, m pubsub.Message) error {
return registerehrid.AfterMath(ctx, m)
}
//SendWakeUpSignal handler
func SendWakeUpSignal(w http.ResponseWriter, r *http.Request) {
wakeup.SendWakeUpSignal(w, r)
}
// ***************
// EFGS functions:
// ***************
// PublishKeys handler.
func PublishKeys(w http.ResponseWriter, r *http.Request) {
publishkeys.PublishKeys(w, r)
}
//EfgsUploadKeys handler.
func EfgsUploadKeys(w http.ResponseWriter, r *http.Request) {
efgs.UploadBatch(w, r)
}
// EfgsDownloadKeys downloads EFGS keys - most recent batch
func EfgsDownloadKeys(w http.ResponseWriter, r *http.Request) {
efgs.DownloadAndSaveKeys(w, r)
}
// EfgsDownloadYesterdaysKeys downloads EFGS keys batch from whole yesterday
func EfgsDownloadYesterdaysKeys(w http.ResponseWriter, r *http.Request) {
efgs.DownloadAndSaveYesterdaysKeys(w, r)
}
// EfgsDownloadYesterdaysKeysPostponed Continues in downloading yesterdays key
func EfgsDownloadYesterdaysKeysPostponed(ctx context.Context, m pubsub.Message) error {
return efgs.DownloadAndSaveYesterdaysKeysPostponed(ctx, m)
}
//EfgsImportKeys Imports given keys
func EfgsImportKeys(ctx context.Context, m pubsub.Message) error {
return efgs.ImportKeysToKeyServer(ctx, m)
}
//EfgsRemoveOldKeys handler.
func EfgsRemoveOldKeys(w http.ResponseWriter, r *http.Request) {
efgs.CleanupDatabase(w, r)
}
//EfgsIssueTestingVerificationCode handler.
func EfgsIssueTestingVerificationCode(w http.ResponseWriter, r *http.Request) {
efgs.IssueTestingVerificationCode(w, r)
}