feat: provider v0.1.9 — namespace hardcoded in client, removed from provider schema and all examples

This commit is contained in:
“Naeel”
2026-03-09 15:27:55 +04:00
parent 17d32fcb39
commit 5faec45a04
9 changed files with 23 additions and 41 deletions
+6 -3
View File
@@ -23,16 +23,19 @@ type Client struct {
httpClient *http.Client
endpoint string
token string
Namespace string // берётся из provider {}, пользователь не касается
// Namespace захардкодено = "default".
// TODO: изоляция пользователей — каждый токен привязан к своему namespace,
// провайдер получает его через GET /v1/whoami. Сейчас всё в одном ns для демо.
Namespace string
}
// New создаёт клиент. endpoint — базовый URL оператора (без trailing slash).
func New(endpoint, token, namespace string) *Client {
func New(endpoint, token string) *Client {
return &Client{
httpClient: &http.Client{Timeout: 30 * time.Second},
endpoint: endpoint,
token: token,
Namespace: namespace,
Namespace: "default",
}
}