Documentation
¶
Overview ¶
Package cloudproject reads a DataTug Cloud project owned by a Space through the DataTug backend's /v0/datatug/* endpoints, the same reads datatug.app makes. It never talks to Firestore: the backend checks the caller's Space membership and the project's access on every read (spec/features/cli/cloud-projects).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is a 404: the project does not exist or was deleted. ErrNotFound = errors.New("project not found, or it was deleted") ErrUnauthorized = errors.New("DataTug sign-in expired") // ErrForbidden is a 403: the account may not read the project. ErrForbidden = errors.New("no access to this project") ErrUnavailable = errors.New("can't reach DataTug Cloud") )
Errors of a read. Each maps to one exit code and one line of the CLI.
Functions ¶
func ValidIdentifier ¶
ValidIdentifier reports whether s is a valid Space or project id: the rule of datatug.app's isSharedProjectIdentifier and the backend's ValidateSharedProjectIdentifier.
Types ¶
type Client ¶
type Client struct {
// BaseURL ends with "/v0/".
BaseURL string
// HTTP must not follow redirects, so a bearer never reaches another host.
HTTP *http.Client
// Token returns the current bearer.
Token func(context.Context) (string, error)
}
Client sends authenticated GET requests to the backend.
type Project ¶
type Project struct {
Ref Ref
ID, Title string
Environments []Item
EnvsErr error
Databases []Item
DBsErr error
// Queries are ids, with "<folder>/<id>" for a query in a folder.
Queries []Item
QueriesErr error
}
Project is what the terminal UI shows of a cloud project. A list that failed to load carries its error, shown in its own panel.