21 lines
457 B
Go
21 lines
457 B
Go
// Package web provides HTTP server related functions and structures.
|
|
package web
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
// Server represents a HTTP server with logging and routing capabilities.
|
|
type Server struct {
|
|
Log *zap.Logger
|
|
Router *http.ServeMux
|
|
Services map[string]interface{}
|
|
}
|
|
|
|
// AddService adds a service to the server's service map.
|
|
func (s *Server) AddService(name string, service interface{}) {
|
|
s.Services[name] = service
|
|
}
|