feat:#36 added protobuf communication for modules

This commit is contained in:
Elmar Kresse
2024-06-17 00:59:33 +02:00
parent 8548a537ec
commit fad85f2884
18 changed files with 1286 additions and 59 deletions

View File

@@ -6,9 +6,7 @@ import (
"time"
)
const host = "http://htwkalender-data-manager:8090"
func RequestApi(path string) (*client.Response, error) {
func RequestApi(host string, path string) (*client.Response, error) {
cc := client.New()
cc.SetTimeout(5 * time.Second)
@@ -22,7 +20,7 @@ func RequestApi(path string) (*client.Response, error) {
return response, nil
}
func DeleteRequestApi(path string) error {
func DeleteRequestApi(host string, path string) error {
cc := client.New()
cc.SetTimeout(5 * time.Second)
@@ -36,7 +34,7 @@ func DeleteRequestApi(path string) error {
return nil
}
func PostRequestApi(path string, body []model.FeedCollection) (*client.Response, error) {
func PostRequestApi(host string, path string, body []model.FeedCollection) (*client.Response, error) {
cc := client.New()
cc.SetTimeout(5 * time.Second)