middlewares

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTokenContextKey contextKey = "authToken"
	IDTokenContextKey   contextKey = "idToken"
)
View Source
const (
	// MCPBypassHeader marks internal MCP requests to prevent middleware loops
	MCPBypassHeader = "X-MCP-Bypass"

	// MaxMCPAgentIterations limits the number of agent loop iterations
	MaxMCPAgentIterations = 10
)
View Source
const (
	A2ABypassHeader = "X-A2A-Bypass"
)
View Source
const (
	// ChatCompletionsPath is the endpoint path for chat completions
	ChatCompletionsPath = "/v1/chat/completions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type A2AMiddleware added in v0.10.0

type A2AMiddleware interface {
	Middleware() gin.HandlerFunc
}

A2AMiddleware defines the interface for A2A middleware

func NewA2AMiddleware added in v0.10.0

func NewA2AMiddleware(registry providers.ProviderRegistry, a2aClient a2a.A2AClientInterface, a2aAgent a2a.Agent, log logger.Logger, inferenceGatewayClient providers.Client, cfg config.Config) (A2AMiddleware, error)

NewA2AMiddleware creates a new A2A middleware instance

type A2AMiddlewareImpl added in v0.10.0

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

A2AMiddlewareImpl implements the A2A middleware

func (*A2AMiddlewareImpl) Middleware added in v0.10.0

func (m *A2AMiddlewareImpl) Middleware() gin.HandlerFunc

Middleware returns the A2A middleware handler

type A2AProviderModelResult added in v0.10.0

type A2AProviderModelResult struct {
	Provider      providers.IProvider
	ProviderModel string
	ProviderID    *providers.Provider
}

A2AProviderModelResult contains the result of provider and model determination

type ErrorResponse added in v0.7.5

type ErrorResponse struct {
	Error string `json:"error"`
}

type Logger added in v0.1.6

type Logger interface {
	Middleware() gin.HandlerFunc
}

func NewLoggerMiddleware added in v0.1.6

func NewLoggerMiddleware(logger *logger.Logger) (Logger, error)

type LoggerImpl added in v0.1.6

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

func (LoggerImpl) Middleware added in v0.1.6

func (l LoggerImpl) Middleware() gin.HandlerFunc

type MCPMiddleware added in v0.7.0

type MCPMiddleware interface {
	Middleware() gin.HandlerFunc
}

MCPMiddleware defines the interface for MCP middleware

func NewMCPMiddleware added in v0.7.0

func NewMCPMiddleware(registry providers.ProviderRegistry, inferenceGatewayClient providers.Client, mcpClient mcp.MCPClientInterface, mcpAgent mcp.Agent, log logger.Logger, cfg config.Config) (MCPMiddleware, error)

NewMCPMiddleware creates a new MCP middleware instance

type MCPMiddlewareImpl added in v0.7.0

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

MCPMiddlewareImpl implements the MCP middleware

func (*MCPMiddlewareImpl) Middleware added in v0.7.0

func (m *MCPMiddlewareImpl) Middleware() gin.HandlerFunc

Middleware returns the MCP middleware handler

type MCPProviderModelResult added in v0.10.0

type MCPProviderModelResult struct {
	Provider      providers.IProvider
	ProviderModel string
	ProviderID    *providers.Provider
}

MCPProviderModelResult contains the result of provider and model determination

type NoopA2AMiddlewareImpl added in v0.10.0

type NoopA2AMiddlewareImpl struct{}

NoopA2AMiddlewareImpl is a no-operation implementation of A2AMiddleware

func (*NoopA2AMiddlewareImpl) Middleware added in v0.10.0

func (n *NoopA2AMiddlewareImpl) Middleware() gin.HandlerFunc

Middleware returns a no-op handler for the noop implementation

type NoopMCPMiddlewareImpl added in v0.7.0

type NoopMCPMiddlewareImpl struct{}

NoopMCPMiddlewareImpl is a no-op implementation of MCPMiddleware

func (*NoopMCPMiddlewareImpl) Middleware added in v0.7.0

func (n *NoopMCPMiddlewareImpl) Middleware() gin.HandlerFunc

Middleware returns the no-op middleware handler

type OIDCAuthenticator

type OIDCAuthenticator interface {
	Middleware() gin.HandlerFunc
}

func NewOIDCAuthenticatorMiddleware added in v0.1.6

func NewOIDCAuthenticatorMiddleware(logger logger.Logger, cfg config.Config) (OIDCAuthenticator, error)

NewOIDCAuthenticatorMiddleware creates a new OIDCAuthenticator instance

type OIDCAuthenticatorImpl

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

func (*OIDCAuthenticatorImpl) Middleware

func (a *OIDCAuthenticatorImpl) Middleware() gin.HandlerFunc

Middleware implementation of the OIDCAuthenticator interface

type OIDCAuthenticatorNoop

type OIDCAuthenticatorNoop struct{}

func (*OIDCAuthenticatorNoop) Middleware

func (a *OIDCAuthenticatorNoop) Middleware() gin.HandlerFunc

Noop implementation of the OIDCAuthenticator interface

type Telemetry added in v0.1.6

type Telemetry interface {
	Middleware() gin.HandlerFunc
}

func NewTelemetryMiddleware added in v0.1.6

func NewTelemetryMiddleware(cfg config.Config, telemetry otel.OpenTelemetry, logger logger.Logger) (Telemetry, error)

type TelemetryImpl added in v0.1.6

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

func (*TelemetryImpl) Middleware added in v0.1.6

func (t *TelemetryImpl) Middleware() gin.HandlerFunc

Jump to

Keyboard shortcuts

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