update authorized.go, database.go, go.mod, server.go

This commit is contained in:
redtea committed 2024-10-21 12:00:00 +03:00
1 parent b7d0e58ebf
commit 33a3121296
4 files changed
+162

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
package esaccount
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)
}