middleware

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenContextKey = "_piko_token"
)

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(config log.AccessLogConfig, logger log.Logger) gin.HandlerFunc

NewLogger creates logging middleware for the access log.

Types

type Auth added in v0.6.1

type Auth struct {
	// contains filtered or unexported fields
}

Auth is middleware to verify token requests.

func NewAuth added in v0.6.1

func NewAuth(verifier *auth.MultiTenantVerifier, logger log.Logger) *Auth

func (*Auth) Verify added in v0.6.1

func (m *Auth) Verify(c *gin.Context)

Verify verifies the request endpoint token and adds to the context.

If the token is invalid, returns 401 to the client.

type Metrics

type Metrics struct {
	RequestsInFlight prometheus.Gauge
	RequestsTotal    *prometheus.CounterVec
	RequestLatency   *prometheus.HistogramVec
	RequestSize      prometheus.Histogram
	ResponseSize     prometheus.Histogram
}

func NewMetrics

func NewMetrics(subsystem string) *Metrics

func (*Metrics) Handler

func (m *Metrics) Handler() gin.HandlerFunc

func (*Metrics) Register

func (m *Metrics) Register(registry *prometheus.Registry)

Jump to

Keyboard shortcuts

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