restructure: console→client-console, add admin-console skeleton, move docs to doc/

This commit is contained in:
“Naeel”
2026-05-25 09:48:55 +04:00
parent 3e36ff13a8
commit 34a8068da5
110 changed files with 615 additions and 0 deletions
@@ -0,0 +1,23 @@
package billing
import (
"context"
"log"
"os"
)
// NewStore создаёт Store из переменной окружения BILLING_DSN.
// Если DSN пустой — возвращает NoopStore (статистика отключена, сервер работает нормально).
func NewStore() Store {
dsn := os.Getenv("BILLING_DSN")
if dsn == "" {
log.Printf("billing: BILLING_DSN not set, statistics disabled")
return NoopStore{}
}
store, err := NewPostgresStore(context.Background(), dsn)
if err != nil {
log.Printf("billing: failed to connect to PostgreSQL: %v — statistics disabled", err)
return NoopStore{}
}
return store
}