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
+40
View File
@@ -0,0 +1,40 @@
package model
// ErrResp — стандартный ответ с ошибкой.
func ErrResp(msg string) map[string]string {
return map[string]string{"error": msg}
}
// NamespaceInfo — информация об одном клиентском namespace.
type NamespaceInfo struct {
Name string `json:"name"`
UserEmail string `json:"user_email,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
// счётчики ресурсов Fission
Functions int `json:"functions"`
Packages int `json:"packages"`
Environments int `json:"environments"`
HTTPTriggers int `json:"http_triggers"`
TimeTriggers int `json:"time_triggers"`
}
// UsageEntry — строка использования для одного namespace (для бухгалтерии).
type UsageEntry struct {
Namespace string `json:"namespace"`
UserEmail string `json:"user_email,omitempty"`
Functions int `json:"functions"`
Invocations int64 `json:"invocations_total"` // TODO: из Prometheus/logs
StorageGB float64 `json:"storage_gb"` // TODO: из storagesvc/S3
CPUMilliCores int64 `json:"cpu_millicores"` // TODO: из metrics-server
MemoryMB int64 `json:"memory_mb"` // TODO: из metrics-server
PeriodStart string `json:"period_start"`
PeriodEnd string `json:"period_end"`
}
// UserInfo — пользователь из secret fission-console-users.
type UserInfo struct {
Email string `json:"email"`
Namespace string `json:"namespace"`
CreatedAt string `json:"created_at,omitempty"`
}