Basic functionality working
Some checks failed
Deploy and Push Docker Image / BuildAndPush (push) Failing after 14s

This commit is contained in:
Henri Burau
2025-06-19 13:57:36 +02:00
parent fac655242f
commit 64f955c4a1
8 changed files with 293 additions and 0 deletions

28
internal/server/server.go Normal file
View File

@ -0,0 +1,28 @@
package server
import (
"fmt"
"net/http"
"sync"
"gitea.henriburau.de/ace966/WeeWooWebhook/internal/olc"
)
type Server struct {
OfficeLightClient *olc.OfficeLightClient
downServices map[int]bool
mu sync.Mutex
}
func NewServer(olc *olc.OfficeLightClient) *Server {
return &Server{
OfficeLightClient: olc,
downServices: make(map[int]bool),
}
}
func (s *Server) ListenAndServe() error {
fmt.Println("Server listening on :8085/wehook...")
http.HandleFunc("/webhook", s.webhookHandler())
return http.ListenAndServe(":8085", nil)
}