Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIController ¶
type APIController struct {
// contains filtered or unexported fields
}
APIController is a server that registers endpoints for a REST API
func NewAPIController ¶
func NewAPIController(opts ...APIControllerOpt) *APIController
NewAPIController creates an API Handler for REST API
func (*APIController) Router ¶
func (c *APIController) Router() http.Handler
Router returns the http handler for serving REST API Server routes
type APIControllerOpt ¶
type APIControllerOpt interface {
// contains filtered or unexported methods
}
APIControllerOpt in an interface for applying APIHandler options.
func WithLogger ¶
func WithLogger(l *slog.Logger) APIControllerOpt
WithLogger applies a custom logger for the APIHandler
func WithMeter ¶
func WithMeter(m metricapi.Meter) APIControllerOpt
WithMeter applies a custom OpenTelemetry Meter for the APIHandler (if not set no metrics are collected)
func WithTracer ¶
func WithTracer(t traceapi.Tracer) APIControllerOpt
WithTracer applies a custom OpenTelemetry Tracer for the APIHandler (if not set no traces are collected)
Click to show internal directories.
Click to hide internal directories.