gateway

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthInterceptor

func AuthInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor

AuthInterceptor handles authentication and authorization

func ClientCertMiddleware

func ClientCertMiddleware(next http.Handler) http.Handler

ClientCertMiddleware validates client certificates for HTTP requests

func HealthCheckHandler

func HealthCheckHandler() http.Handler

HealthCheckHandler provides a simple health check endpoint

func InitMetrics

func InitMetrics()

InitMetrics initializes the global metrics registry

func LoggingInterceptor

func LoggingInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor

LoggingInterceptor logs all gRPC requests and responses

func MetricsHandler

func MetricsHandler() http.Handler

MetricsHandler provides a Prometheus metrics endpoint

func MetricsInterceptor

func MetricsInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor

MetricsInterceptor collects metrics for gRPC requests

func NewHTTPGateway

func NewHTTPGateway(ctx context.Context, config GatewayConfig, logger *log.Logger) (http.Handler, error)

NewHTTPGateway creates a new HTTP-to-gRPC gateway

func RateLimitingInterceptor

func RateLimitingInterceptor(logger *log.Logger, requestsPerSecond int) grpc.UnaryServerInterceptor

RateLimitingInterceptor implements basic rate limiting

func RecoveryInterceptor

func RecoveryInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor

RecoveryInterceptor recovers from panics and returns appropriate errors

func SwaggerSpecHandler

func SwaggerSpecHandler() http.Handler

SwaggerSpecHandler serves the OpenAPI specification JSON

func SwaggerUIHandler

func SwaggerUIHandler() http.Handler

SwaggerUIHandler serves the Swagger UI for API documentation

func ValidationInterceptor

func ValidationInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor

ValidationInterceptor validates incoming requests

func VerifyPeerCertificateInterceptor

func VerifyPeerCertificateInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

VerifyPeerCertificateInterceptor validates client certificates for gRPC requests

Types

type GatewayConfig

type GatewayConfig struct {
	GRPCServerAddr string
	HTTPAddr       string
	CORSEnabled    bool
	AllowedOrigins []string
}

GatewayConfig holds configuration for the HTTP gateway

Jump to

Keyboard shortcuts

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