api

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(svc converters.Service, logger log.Logger) converters.Service

LoggingMiddleware adds logging facilities to the adapter.

func MakeHandler

func MakeHandler(svc adapter.Service, tracer opentracing.Tracer, logger logger.Logger) http.Handler

MakeHandler returns a HTTP handler for API endpoints.

func MetricsMiddleware

func MetricsMiddleware(svc converters.Service, counter metrics.Counter, latency metrics.Histogram) converters.Service

MetricsMiddleware instruments adapter by tracking request count and latency.

Types

type SenmlRec

type SenmlRec struct {
	Name  string `json:"n"`
	Time  string `json:"t"`
	Value string `json:"v"`
}

Jump to

Keyboard shortcuts

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