commit 3070e9d1ab39c76578637aaf444ba655b0616a76 Author: Denis Istratov Date: Sat Oct 19 12:00:00 2024 +0300 update icon.png, privacy-policy.pdf, server.go diff --git a/public/resources/icon.png b/public/resources/icon.png new file mode 100644 index 0000000..27f369d Binary files /dev/null and b/public/resources/icon.png differ diff --git a/public/resources/privacy-policy.pdf b/public/resources/privacy-policy.pdf new file mode 100644 index 0000000..ba679ce Binary files /dev/null and b/public/resources/privacy-policy.pdf differ diff --git a/server.go b/server.go new file mode 100644 index 0000000..8269f2a --- /dev/null +++ b/server.go @@ -0,0 +1,27 @@ +package esauth + +import ( + "context" + "net/http" + "time" +) + +type Server struct { + httpServer *http.Server +} + +func (s *Server) Run(port string, handler http.Handler) error { + s.httpServer = &http.Server{ + Addr: ":" + port, + Handler: handler, + MaxHeaderBytes: 1 << 20, + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + } + + return s.httpServer.ListenAndServe() +} + +func (s *Server) Shutdown(ctx context.Context) error { + return s.httpServer.Shutdown(ctx) +}