tenant

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tenant provides multi-tenant protocol library isolation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEntry

type AuditEntry struct {
	TenantID string `json:"tenant_id"`
	Action   string `json:"action"`
	Resource string `json:"resource"`
}

AuditEntry represents an audit log entry.

type Manager

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

Manager manages multi-tenant protocol libraries.

func NewManager

func NewManager() *Manager

NewManager creates a new tenant manager.

func (*Manager) AddProtocol

func (m *Manager) AddProtocol(tenantID, protocol string) error

AddProtocol adds a protocol to a tenant.

func (*Manager) CreateTenant

func (m *Manager) CreateTenant(id, name string, quota Quota) error

CreateTenant creates a new tenant.

func (*Manager) Describe

func (m *Manager) Describe() string

Describe returns a description of all tenants.

func (*Manager) GetAuditLog

func (m *Manager) GetAuditLog(tenantID string) []AuditEntry

GetAuditLog returns audit entries for a tenant.

type Quota

type Quota struct {
	MaxProtocols int `json:"max_protocols"`
	MaxRequests  int `json:"max_requests_per_min"`
}

Quota represents tenant resource quotas.

type Tenant

type Tenant struct {
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Protocols []string `json:"protocols"`
	Quota     Quota    `json:"quota"`
}

Tenant represents a tenant with isolated protocol library.

Jump to

Keyboard shortcuts

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