Documentation
¶
Index ¶
- func Error(w http.ResponseWriter, status int, err *types.ErrorV1)
- func ErrorString(w http.ResponseWriter, status int, code string, err error)
- func JSON(w http.ResponseWriter, code int, v any, pretty bool)
- func JSONOK(w http.ResponseWriter, v any, pretty bool)
- type Server
- func (s *Server) Init() *Server
- func (s *Server) ListenAndServe(addr string) error
- func (s *Server) WithConfig(cfg *config.Root) *Server
- func (s *Server) WithDatabase(db *database.Database) *Server
- func (s *Server) WithMetrics(m *metrics.Metrics) *Server
- func (s *Server) WithPrometheusRegisterer(reg prometheus.Registerer) *Server
- func (s *Server) WithReadiness(fn func(context.Context) error) *Server
- func (s *Server) WithRouter(router *http.ServeMux) *Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorString ¶
func ErrorString(w http.ResponseWriter, status int, code string, err error)
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
func (*Server) WithMetrics ¶ added in v0.7.0
func (*Server) WithPrometheusRegisterer ¶ added in v0.7.0
func (s *Server) WithPrometheusRegisterer(reg prometheus.Registerer) *Server
func (*Server) WithReadiness ¶
Click to show internal directories.
Click to hide internal directories.