rest

package
v0.0.0-...-3fa0160 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 8 Imported by: 0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL