forked from ebhomengo/niki
23 lines
383 B
Go
23 lines
383 B
Go
package http
|
|
|
|
type Server struct {
|
|
httpServer *httpserver.Server
|
|
handler *Handler
|
|
}
|
|
|
|
func NewServer(httpServer *httpserver.Server, handler *Handler) *Server {
|
|
return &Server{
|
|
httpServer: httpServer,
|
|
handler: handler,
|
|
}
|
|
}
|
|
|
|
func (s *Server) Serve() error {
|
|
s.registerRoutes()
|
|
return s.httpServer.Start()
|
|
}
|
|
|
|
func (s *Server) Stop() error {
|
|
return s.httpServer.Stop()
|
|
}
|