ginsaas

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ginsaas adapts SaaS tenant middleware and guards to Gin.

包 ginsaas 将 SaaS 租户中间件和防护机制适配到 Gin。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler() gin.HandlerFunc

ErrorHandler returns a generic error response without exposing tenant internals.

func HostGuardMiddleware

func HostGuardMiddleware() gin.HandlerFunc

HostGuardMiddleware allows only explicit host context.

func TenantMiddleware

func TenantMiddleware(resolver resolver.Resolver, store store.Store, opts ...Option) gin.HandlerFunc

TenantMiddleware resolves the current tenant and stores it in request context.

func TenantStatusGuard

func TenantStatusGuard() gin.HandlerFunc

TenantStatusGuard allows only active tenants.

Types

type Config added in v0.3.1

type Config struct {
	DeploymentResolver deployment.Resolver
}

Config controls optional tenant middleware integrations.

type Option added in v0.3.1

type Option func(*Config)

Option configures TenantMiddleware.

func WithDeploymentResolver added in v0.3.1

func WithDeploymentResolver(resolver deployment.Resolver) Option

WithDeploymentResolver resolves a tenant's current deployment unit after tenant lookup succeeds. Passing nil leaves deployment resolution disabled.

Jump to

Keyboard shortcuts

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