{"modulePath":"github.com/lukcba-developers/gopherkit","version":"v1.0.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package database\n\nPackage database - Connection Management System Migrated from ClubPulse to gopherkit with significant improvements\n\nPackage database - Fallback Management System Migrado de ClubPulse a gopherkit con mejoras significativas\n\nPackage database - Health Checking System Migrado de ClubPulse a gopherkit con mejoras significativas\n\nPackage database - Tenant Context Management System Migrado de ClubPulse a gopherkit con mejoras significativas\n\n## Types\n\n```go\ntype CheckDetail struct {\n\tName        string        `json:\"name\"`\n\tStatus      HealthStatus  `json:\"status\"`\n\tDuration    time.Duration `json:\"duration\"`\n\tDescription string        `json:\"description\"`\n\tError       string        `json:\"error,omitempty\"`\n}\n```\nCheckDetail detalle de una verificación específica\n\n```go\ntype Config struct {\n\t// Common fields\n\tDatabaseMode DatabaseMode `json:\"database_mode\"`\n\tDatabaseURL  string       `json:\"database_url\"`\n\n\t// Single mode specific\n\tDatabaseSchema string `json:\"database_schema\"`\n\n\t// Connection pool settings\n\tMaxOpenConns        int           `json:\"max_open_conns\"`\n\tMaxIdleConns        int           `json:\"max_idle_conns\"`\n\tConnMaxLifetime     time.Duration `json:\"conn_max_lifetime\"`\n\tConnMaxIdleTime     time.Duration `json:\"conn_max_idle_time\"`\n\tEnableFallback      bool          `json:\"enable_fallback\"`\n\tFallbackDatabaseURL string        `json:\"fallback_database_url\"`\n\n\t// Monitoring and observability\n\tEnableMetrics        bool          `json:\"enable_metrics\"`\n\tServiceName          string        `json:\"service_name\"`\n\tEnableHealthChecks   bool          `json:\"enable_health_checks\"`\n\tHealthCheckInterval  time.Duration `json:\"health_check_interval\"`\n\tEnableRetryLogic     bool          `json:\"enable_retry_logic\"`\n\tMaxRetryAttempts     int           `json:\"max_retry_attempts\"`\n\tRetryBackoffDuration time.Duration `json:\"retry_backoff_duration\"`\n\tConnectionTimeout    time.Duration `json:\"connection_timeout\"`\n\tEnableSlowQueryLog   bool          `json:\"enable_slow_query_log\"`\n\tSlowQueryThreshold   time.Duration `json:\"slow_query_threshold\"`\n}\n```\nConfig holds database configuration with enhanced options\n\n```go\nfunc DefaultConfig() *Config\n```\nDefaultConfig retorna configuración por defecto mejorada\n\n```go\ntype ConnectionManager struct {\n\t// contains filtered or unexported fields\n}\n```\nConnectionManager manages database connections with enhanced features\n\n```go\nfunc GetInstance(config *Config) (*ConnectionManager, error)\n```\nGetInstance returns singleton instance of ConnectionManager\n\n```go\nfunc NewConnectionManager(config *Config) (*ConnectionManager, error)\n```\nNewConnectionManager creates a new enhanced connection manager\n\n```go\nfunc (cm *ConnectionManager) Close() error\n```\nClose closes all database connections with graceful shutdown\n\n```go\nfunc (cm *ConnectionManager) ExecuteInSchema(schema string, query string, args ...interface{}) (*sql.Rows, error)\n```\nExecuteInSchema executes a query in a specific schema (single mode only) with improvements\n\n```go\nfunc (cm *ConnectionManager) ExecuteWithMetrics(query string, args ...interface{}) (*sql.Rows, error)\n```\nExecuteWithMetrics executes a query with performance metrics\n\n```go\nfunc (cm *ConnectionManager) GetDB() *sql.DB\n```\nGetDB returns the active database connection with intelligent fallback\n\n```go\nfunc (cm *ConnectionManager) GetHealthStatus() map[string]interface{}\n```\nGetHealthStatus returns current enhanced health status\n\n```go\nfunc (cm *ConnectionManager) GetQueryHistory() []QueryMetric\n```\nGetQueryHistory returns recent query history\n\n```go\nfunc (cm *ConnectionManager) ResetMetrics()\n```\nResetMetrics resets all connection metrics\n\n```go\nfunc (cm *ConnectionManager) Transaction(fn func(*sql.Tx) error) error\n```\nTransaction executes a function within a database transaction with enhanced error handling\n\n```go\ntype ConnectionMetrics struct {\n\tTotalConnections    int64            `json:\"total_connections\"`\n\tActiveConnections   int64            `json:\"active_connections\"`\n\tFailedConnections   int64            `json:\"failed_connections\"`\n\tFallbackUsed        int64            `json:\"fallback_used\"`\n\tQueryTime           time.Duration    `json:\"query_time\"`\n\tSchemaQueries       map[string]int64 `json:\"schema_queries\"`\n\tSlowQueries         int64            `json:\"slow_queries\"`\n\tConnectionErrors    map[string]int64 `json:\"connection_errors\"`\n\tQueryHistory        []QueryMetric    `json:\"query_history\"`\n\tHealthCheckFailures int64            `json:\"health_check_failures\"`\n\tRecoveryAttempts    int64            `json:\"recovery_attempts\"`\n\tLastError           string           `json:\"last_error\"`\n\tLastErrorTime       time.Time        `json:\"last_error_time\"`\n\t// contains filtered or unexported fields\n}\n```\nConnectionMetrics tracks enhanced connection statistics\n\n```go\ntype DatabaseMode string\n```\nDatabaseMode represents the database operation mode\n\n```go\nconst (\n\tModeSingle DatabaseMode = \"single\"\n\tModeMulti  DatabaseMode = \"multi\"\n)\n```\n\n```go\ntype DefaultLogger struct{}\n```\nDefaultLogger implementación simple de logger\n\n```go\nfunc (dl *DefaultLogger) Debugf(format string, args ...interface{})\n```\n\n```go\nfunc (dl *DefaultLogger) Error(msg string)\n```\n\n```go\nfunc (dl *DefaultLogger) Info(msg string)\n```\n\n```go\nfunc (dl *DefaultLogger) Warn(msg string)\n```\n\n```go\nfunc (dl *DefaultLogger) WithField(key string, value interface{}) Logger\n```\n\n```go\ntype FallbackConfig struct {\n\tEnableAutoFallback     bool          `json:\"enable_auto_fallback\"`\n\tHealthCheckInterval    time.Duration `json:\"health_check_interval\"`\n\tFailureThreshold       int           `json:\"failure_threshold\"`\n\tRecoveryCheckInterval  time.Duration `json:\"recovery_check_interval\"`\n\tFallbackTimeout        time.Duration `json:\"fallback_timeout\"`\n\tAlertWebhookURL        string        `json:\"alert_webhook_url\"`\n\tMaxRetryAttempts       int           `json:\"max_retry_attempts\"`\n\tRetryBackoffMultiplier float64       `json:\"retry_backoff_multiplier\"`\n\tEnableNotifications    bool          `json:\"enable_notifications\"`\n\tNotificationChannels   []string      `json:\"notification_channels\"`\n\tAutoRecoveryEnabled    bool          `json:\"auto_recovery_enabled\"`\n\tRecoveryConfidence     float64       `json:\"recovery_confidence\"`\n}\n```\nFallbackConfig configuración mejorada para el sistema de fallback\n\n```go\nfunc DefaultFallbackConfig() *FallbackConfig\n```\nDefaultFallbackConfig retorna configuración por defecto mejorada\n\n```go\ntype FallbackManager struct {\n\t// contains filtered or unexported fields\n}\n```\nFallbackManager gestiona el fallback automático entre modos de database mejorado\n\n```go\nfunc NewFallbackManager(config *Config, logger Logger) (*FallbackManager, error)\n```\nNewFallbackManager crea un nuevo gestor de fallback mejorado\n\n```go\nfunc (fm *FallbackManager) ForceRecovery() error\n```\nForceRecovery fuerza un intento de recuperación manual\n\n```go\nfunc (fm *FallbackManager) GetCurrentMode() DatabaseMode\n```\nGetCurrentMode obtiene el modo actual de la database\n\n```go\nfunc (fm *FallbackManager) GetMetrics() *FallbackMetrics\n```\nGetMetrics retorna las métricas del fallback manager\n\n```go\nfunc (fm *FallbackManager) IsInFallbackMode() bool\n```\nIsInFallbackMode verifica si está en modo fallback\n\n```go\nfunc (fm *FallbackManager) SetAlertCallback(callback func(string, error))\n```\nSetAlertCallback permite configurar un callback personalizado para alertas\n\n```go\nfunc (fm *FallbackManager) SetPrimaryDB(db *sql.DB)\n```\nSetPrimaryDB establece la conexión primaria\n\n```go\nfunc (fm *FallbackManager) Stop()\n```\nStop detiene el monitoreo de fallback con limpieza mejorada\n\n```go\ntype FallbackMetrics struct {\n\tFallbackActivations  int64                    `json:\"fallback_activations\"`\n\tRecoveryAttempts     int64                    `json:\"recovery_attempts\"`\n\tSuccessfulRecoveries int64                    `json:\"successful_recoveries\"`\n\tFailedRecoveries     int64                    `json:\"failed_recoveries\"`\n\tTimeInFallbackMode   time.Duration            `json:\"time_in_fallback_mode\"`\n\tLastFallbackTime     time.Time                `json:\"last_fallback_time\"`\n\tLastRecoveryTime     time.Time                `json:\"last_recovery_time\"`\n\tHealthCheckFailures  map[string]int64         `json:\"health_check_failures\"`\n\tFallbackDuration     map[string]time.Duration `json:\"fallback_duration\"`\n\tAlertsSent           int64                    `json:\"alerts_sent\"`\n\t// contains filtered or unexported fields\n}\n```\nFallbackMetrics métricas del sistema de fallback\n\n```go\ntype GormLogger struct {\n\t// contains filtered or unexported fields\n}\n```\nCustom GORM logger that integrates with our logger\n\n```go\nfunc NewGormLogger(logger logger.Logger) *GormLogger\n```\nNewGormLogger creates a new GORM logger\n\n```go\nfunc (gl *GormLogger) Error(ctx context.Context, msg string, data ...interface{})\n```\nError logs error messages\n\n```go\nfunc (gl *GormLogger) Info(ctx context.Context, msg string, data ...interface{})\n```\nInfo logs info messages\n\n```go\nfunc (gl *GormLogger) LogMode(level gormlogger.LogLevel) gormlogger.Interface\n```\nLogMode sets the log level\n\n```go\nfunc (gl *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)\n```\nTrace logs SQL queries\n\n```go\nfunc (gl *GormLogger) Warn(ctx context.Context, msg string, data ...interface{})\n```\nWarn logs warning messages\n\n```go\ntype HealthCheckResult struct {\n\tService      string        `json:\"service\"`\n\tStatus       HealthStatus  `json:\"status\"`\n\tResponseTime time.Duration `json:\"response_time\"`\n\tError        string        `json:\"error,omitempty\"`\n\tDetails      interface{}   `json:\"details,omitempty\"`\n\tTimestamp    time.Time     `json:\"timestamp\"`\n\tChecks       []CheckDetail `json:\"checks,omitempty\"`\n\tSeverity     Severity      `json:\"severity\"`\n\tSuggestions  []string      `json:\"suggestions,omitempty\"`\n}\n```\nHealthCheckResult resultado mejorado de una verificación de salud\n\n```go\ntype HealthChecker struct {\n\t// contains filtered or unexported fields\n}\n```\nHealthChecker realiza verificaciones de salud de databases mejorado\n\n```go\nfunc NewHealthChecker(config *Config) *HealthChecker\n```\nNewHealthChecker crea un nuevo verificador de salud mejorado\n\n```go\nfunc (hc *HealthChecker) CheckAllServices(ctx context.Context) ([]*HealthCheckResult, error)\n```\nCheckAllServices verifica la salud de todos los servicios con mejoras\n\n```go\nfunc (hc *HealthChecker) CheckDatabase(ctx context.Context, db *sql.DB, serviceName string) *HealthCheckResult\n```\nCheckDatabase verifica la salud de una database específica con mejoras\n\n```go\nfunc (hc *HealthChecker) CheckWithRetry(ctx context.Context, db *sql.DB, serviceName string, maxRetries int) *HealthCheckResult\n```\nCheckWithRetry verifica con reintentos mejorado\n\n```go\nfunc (hc *HealthChecker) GenerateHealthReport(ctx context.Context) (HealthReport, error)\n```\nGenerateHealthReport genera un reporte completo de salud mejorado\n\n```go\nfunc (hc *HealthChecker) GetMetrics() *HealthMetrics\n```\nGetMetrics retorna las métricas del health checker\n\n```go\nfunc (hc *HealthChecker) GetOverallHealth(results []*HealthCheckResult) (HealthStatus, Severity)\n```\nGetOverallHealth calcula el estado general de salud mejorado\n\n```go\ntype HealthMetrics struct {\n\tTotalChecks      int64                    `json:\"total_checks\"`\n\tSuccessfulChecks int64                    `json:\"successful_checks\"`\n\tFailedChecks     int64                    `json:\"failed_checks\"`\n\tCheckDurations   []time.Duration          `json:\"check_durations\"`\n\tServiceFailures  map[string]int64         `json:\"service_failures\"`\n\tLastCheckTime    time.Time                `json:\"last_check_time\"`\n\tAverageCheckTime time.Duration            `json:\"average_check_time\"`\n\tHealthTrends     map[string][]HealthPoint `json:\"health_trends\"`\n\t// contains filtered or unexported fields\n}\n```\nHealthMetrics métricas del health checker\n\n```go\ntype HealthPoint struct {\n\tTimestamp time.Time     `json:\"timestamp\"`\n\tStatus    HealthStatus  `json:\"status\"`\n\tDuration  time.Duration `json:\"duration\"`\n}\n```\nHealthPoint representa un punto en el tiempo para tendencias de salud\n\n```go\ntype HealthReport struct {\n\tTimestamp       time.Time            `json:\"timestamp\"`\n\tDatabaseMode    string               `json:\"database_mode\"`\n\tOverallHealth   HealthStatus         `json:\"overall_health\"`\n\tOverallSeverity Severity             `json:\"overall_severity\"`\n\tServices        []*HealthCheckResult `json:\"services\"`\n\tSummary         HealthSummary        `json:\"summary\"`\n\tRecommendations []string             `json:\"recommendations\"`\n\tMetrics         *HealthMetrics       `json:\"metrics\"`\n}\n```\nHealthReport estructura mejorada del reporte de salud\n\n```go\ntype HealthStatus string\n```\nHealthStatus estado de salud mejorado\n\n```go\nconst (\n\tHealthStatusHealthy   HealthStatus = \"healthy\"\n\tHealthStatusUnhealthy HealthStatus = \"unhealthy\"\n\tHealthStatusDegraded  HealthStatus = \"degraded\"\n\tHealthStatusUnknown   HealthStatus = \"unknown\"\n\tHealthStatusWarning   HealthStatus = \"warning\"\n)\n```\n\n```go\ntype HealthSummary struct {\n\tTotalServices     int `json:\"total_services\"`\n\tHealthyServices   int `json:\"healthy_services\"`\n\tWarningServices   int `json:\"warning_services\"`\n\tDegradedServices  int `json:\"degraded_services\"`\n\tUnhealthyServices int `json:\"unhealthy_services\"`\n}\n```\nHealthSummary resumen mejorado del estado de salud\n\n```go\ntype Logger interface {\n\tInfo(msg string)\n\tWarn(msg string)\n\tError(msg string)\n\tDebugf(format string, args ...interface{})\n\tWithField(key string, value interface{}) Logger\n}\n```\nLogger interface para logging\n\n```go\ntype PostgresClient struct {\n\t// contains filtered or unexported fields\n}\n```\nPostgresClient provides PostgreSQL database operations\n\n```go\nfunc NewPostgresClient(opts PostgresOptions) (*PostgresClient, error)\n```\nNewPostgresClient creates a new PostgreSQL client\n\n```go\nfunc (pc *PostgresClient) Close() error\n```\nClose closes the database connection\n\n```go\nfunc (pc *PostgresClient) GetDB() *gorm.DB\n```\nGetDB returns the GORM database instance\n\n```go\nfunc (pc *PostgresClient) GetSQLDB() *sql.DB\n```\nGetSQLDB returns the underlying sql.DB instance\n\n```go\nfunc (pc *PostgresClient) HealthCheck() observability.HealthCheck\n```\nHealthCheck returns a health check for the database\n\n```go\nfunc (pc *PostgresClient) Stats() sql.DBStats\n```\nStats returns database connection statistics\n\n```go\nfunc (pc *PostgresClient) Transaction(ctx context.Context, fn func(*gorm.DB) error) error\n```\nTransaction executes a function within a database transaction\n\n```go\nfunc (pc *PostgresClient) WithContext(ctx context.Context) *gorm.DB\n```\nWithContext returns a new GORM DB instance with context\n\n```go\ntype PostgresOptions struct {\n\tConfig config.DatabaseConfig\n\tLogger logger.Logger\n\tModels []interface{} // Models to auto-migrate\n}\n```\nPostgresOptions holds options for PostgreSQL client\n\n```go\ntype QueryMetric struct {\n\tQuery     string        `json:\"query\"`\n\tDuration  time.Duration `json:\"duration\"`\n\tSuccess   bool          `json:\"success\"`\n\tError     string        `json:\"error,omitempty\"`\n\tTimestamp time.Time     `json:\"timestamp\"`\n}\n```\nQueryMetric representa métricas de una query individual\n\n```go\ntype RLSStatus struct {\n\tDatabaseName string `db:\"database_name\" json:\"database_name\"`\n\tTableName    string `db:\"table_name\" json:\"table_name\"`\n\tRLSEnabled   bool   `db:\"rls_enabled\" json:\"rls_enabled\"`\n\tPolicyCount  int    `db:\"policy_count\" json:\"policy_count\"`\n}\n```\nRLSStatus representa el estado de Row Level Security para una tabla\n\n```go\ntype Repository struct {\n\t// contains filtered or unexported fields\n}\n```\nRepository provides common repository patterns\n\n```go\nfunc NewRepository(db *gorm.DB, logger logger.Logger) *Repository\n```\nNewRepository creates a new repository instance\n\n```go\nfunc (r *Repository) Create(ctx context.Context, model interface{}) error\n```\nCreate creates a new record\n\n```go\nfunc (r *Repository) Delete(ctx context.Context, model interface{}, id interface{}) error\n```\nDelete deletes a record\n\n```go\nfunc (r *Repository) GetByID(ctx context.Context, model interface{}, id interface{}) error\n```\nGetByID retrieves a record by ID\n\n```go\nfunc (r *Repository) Update(ctx context.Context, model interface{}) error\n```\nUpdate updates a record\n\n```go\ntype Severity string\n```\nSeverity nivel de severidad\n\n```go\nconst (\n\tSeverityCritical Severity = \"critical\"\n\tSeverityHigh     Severity = \"high\"\n\tSeverityMedium   Severity = \"medium\"\n\tSeverityLow      Severity = \"low\"\n\tSeverityInfo     Severity = \"info\"\n)\n```\n\n```go\ntype TenantCache struct {\n\t// contains filtered or unexported fields\n}\n```\nTenantCache cache simple para contextos de tenant\n\n```go\nfunc NewTenantCache(ttl time.Duration, maxSize int) *TenantCache\n```\nNewTenantCache crea un nuevo cache de tenants\n\n```go\nfunc (tc *TenantCache) Get(key string) (string, bool)\n```\nGet obtiene un tenant del cache\n\n```go\nfunc (tc *TenantCache) Set(key, tenantID string)\n```\nSet almacena un tenant en el cache\n\n```go\ntype TenantCacheEntry struct {\n\tTenantID string    `json:\"tenant_id\"`\n\tSetTime  time.Time `json:\"set_time\"`\n\tLastUsed time.Time `json:\"last_used\"`\n\tUseCount int64     `json:\"use_count\"`\n}\n```\nTenantCacheEntry entrada del cache de tenant\n\n```go\ntype TenantConfig struct {\n\tEnableCaching        bool          `json:\"enable_caching\"`\n\tCacheTTL             time.Duration `json:\"cache_ttl\"`\n\tEnableValidation     bool          `json:\"enable_validation\"`\n\tEnableAuditLog       bool          `json:\"enable_audit_log\"`\n\tMaxConcurrentTenants int           `json:\"max_concurrent_tenants\"`\n\tTenantTimeout        time.Duration `json:\"tenant_timeout\"`\n\tEnableMetrics        bool          `json:\"enable_metrics\"`\n\tEnableSecurityChecks bool          `json:\"enable_security_checks\"`\n\tDefaultTenantID      string        `json:\"default_tenant_id\"`\n}\n```\nTenantConfig configuración del sistema de multi-tenancy\n\n```go\nfunc DefaultTenantConfig() *TenantConfig\n```\nDefaultTenantConfig retorna configuración por defecto\n\n```go\ntype TenantContextManager struct {\n\t// contains filtered or unexported fields\n}\n```\nTenantContextManager maneja el contexto de tenant en la base de datos mejorado para implementar Row Level Security (RLS) con funcionalidades avanzadas\n\n```go\nfunc NewTenantContextManager(db *sqlx.DB, logger Logger, config *TenantConfig) *TenantContextManager\n```\nNewTenantContextManager crea una nueva instancia mejorada del manejador de contexto de tenant\n\n```go\nfunc (tcm *TenantContextManager) ClearTenantContext(ctx context.Context) error\n```\nClearTenantContext limpia el contexto de tenant de la sesión con mejoras\n\n```go\nfunc (tcm *TenantContextManager) GetCacheStats() map[string]interface{}\n```\nGetCacheStats retorna estadísticas del cache\n\n```go\nfunc (tcm *TenantContextManager) GetConfig() *TenantConfig\n```\nGetConfig retorna la configuración actual\n\n```go\nfunc (tcm *TenantContextManager) GetCurrentTenant(ctx context.Context) (string, error)\n```\nGetCurrentTenant obtiene el tenant\\_id actual de la sesión de base de datos con mejoras\n\n```go\nfunc (tcm *TenantContextManager) GetMetrics() *TenantMetrics\n```\nGetMetrics retorna las métricas del tenant context manager\n\n```go\nfunc (tcm *TenantContextManager) GetTenantStats(ctx context.Context, tenantID string, tables []string) ([]TenantStats, error)\n```\nGetTenantStats obtiene estadísticas de datos para un tenant específico mejorado\n\n```go\nfunc (tcm *TenantContextManager) HealthCheck(ctx context.Context) error\n```\nHealthCheck verifica que el sistema de multi-tenancy esté funcionando correctamente mejorado\n\n```go\nfunc (tcm *TenantContextManager) ResetMetrics()\n```\nResetMetrics reinicia todas las métricas\n\n```go\nfunc (tcm *TenantContextManager) SetTenantContext(ctx context.Context, tenantID string) error\n```\nSetTenantContext establece el contexto de tenant en la sesión de base de datos con mejoras\n\n```go\nfunc (tcm *TenantContextManager) TenantAwareExec(ctx context.Context, tenantID, query string, args ...interface{}) (sql.Result, error)\n```\nTenantAwareExec ejecuta una declaración SQL con contexto de tenant mejorado\n\n```go\nfunc (tcm *TenantContextManager) TenantAwareQuery(ctx context.Context, tenantID, query string, args ...interface{}) (*sql.Rows, error)\n```\nTenantAwareQuery ejecuta una consulta con contexto de tenant mejorado\n\n```go\nfunc (tcm *TenantContextManager) ValidateTenantAccess(ctx context.Context, tenantID, resourceTable, resourceID string) (bool, error)\n```\nValidateTenantAccess verifica que el tenant tiene acceso a un recurso específico mejorado\n\n```go\nfunc (tcm *TenantContextManager) VerifyRLSStatus(ctx context.Context) ([]RLSStatus, error)\n```\nVerifyRLSStatus verifica que Row Level Security está habilitado con mejoras\n\n```go\nfunc (tcm *TenantContextManager) WithTenantContext(ctx context.Context, tenantID string, fn func(context.Context) error) error\n```\nWithTenantContext ejecuta una función con contexto de tenant establecido mejorado\n\n```go\ntype TenantMetrics struct {\n\tTenantSets         int64                `json:\"tenant_sets\"`\n\tTenantGets         int64                `json:\"tenant_gets\"`\n\tTenantClears       int64                `json:\"tenant_clears\"`\n\tValidationFailures int64                `json:\"validation_failures\"`\n\tSecurityViolations int64                `json:\"security_violations\"`\n\tCacheHits          int64                `json:\"cache_hits\"`\n\tCacheMisses        int64                `json:\"cache_misses\"`\n\tActiveTenants      map[string]time.Time `json:\"active_tenants\"`\n\tTenantOperations   map[string]int64     `json:\"tenant_operations\"`\n\tAverageSetTime     time.Duration        `json:\"average_set_time\"`\n\tAverageGetTime     time.Duration        `json:\"average_get_time\"`\n\tLastOperation      time.Time            `json:\"last_operation\"`\n\tOperationHistory   []TenantOperation    `json:\"operation_history\"`\n\t// contains filtered or unexported fields\n}\n```\nTenantMetrics métricas del sistema de tenancy\n\n```go\ntype TenantOperation struct {\n\tType      string        `json:\"type\"`\n\tTenantID  string        `json:\"tenant_id\"`\n\tSuccess   bool          `json:\"success\"`\n\tDuration  time.Duration `json:\"duration\"`\n\tError     string        `json:\"error,omitempty\"`\n\tTimestamp time.Time     `json:\"timestamp\"`\n}\n```\nTenantOperation representa una operación de tenant\n\n```go\ntype TenantStats struct {\n\tTenantID    string    `json:\"tenant_id\"`\n\tTable       string    `json:\"table\"`\n\tCount       int       `json:\"count\"`\n\tLastUpdated time.Time `json:\"last_updated\"`\n\tSize        int64     `json:\"size_bytes\"`\n}\n```\nTenantStats proporciona estadísticas sobre los datos del tenant mejorado\n\n","path":"github.com/lukcba-developers/gopherkit/pkg/database","name":"database","synopsis":"Package database - Connection Management System Migrated from ClubPulse to gopherkit with significant improvements","isRedistributable":true}
