database

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNoDatabaseAdminRights

func AssertNoDatabaseAdminRights(ctx context.Context, db *gorm.DB) error

func OpenControlDB

func OpenControlDB(dsn string) (*gorm.DB, error)

Types

type TenantContext

type TenantContext struct {
	DB  *gorm.DB
	Key []byte
}

type TenantManager

type TenantManager struct {
	ControlDB *gorm.DB
	// contains filtered or unexported fields
}

func NewTenantManager

func NewTenantManager(controlDB *gorm.DB, masterKeyB64 string, pool TenantPoolConfig) (*TenantManager, error)

func (*TenantManager) Close

func (m *TenantManager) Close() error

func (*TenantManager) Evict

func (m *TenantManager) Evict(orgID string)

func (*TenantManager) GetTenantContext

func (m *TenantManager) GetTenantContext(ctx context.Context, orgID string) (*TenantContext, error)

func (*TenantManager) Len

func (m *TenantManager) Len() int

type TenantPoolConfig

type TenantPoolConfig struct {
	MaxSize         int
	MaxConns        int
	MaxIdleConns    int
	ConnMaxIdleTime time.Duration
	ConnMaxLifetime time.Duration
	EvictGrace      time.Duration
}

Jump to

Keyboard shortcuts

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