Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateProjectID ¶ added in v0.40.0
ValidateProjectID applies DataTug's project-id rules. It is exported so a caller that has to choose an id — a CLI's new-project form, say — can check one without building a whole CreateProjectRequest around it.
A project id is both a DALgo key segment and, under a file-backed store, a directory name, so it is restricted to what is unambiguous in both:
- 1 to maxProjectIDLength characters;
- lower-case ASCII letters, digits, "-" and "_" only. Upper case is refused rather than folded, because a store cloned onto a case-insensitive file system (macOS, Windows) would collapse two ids that differ only in case into one directory;
- the first and last character must be a letter or a digit, so an id never starts or ends with "-" or "_".
The charset rules out every path separator, "." and "..", whitespace and control characters, so no id can escape or rename its own directory.
Types ¶
type CreateFolder ¶
type CreateFolder struct {
ProjectRef
Name string `json:"name"`
Path string `json:"path"`
Note string `json:"note,omitempty"`
}
CreateFolder defines request for folder creation
func (CreateFolder) Validate ¶
func (v CreateFolder) Validate() error
Validate returns error if not valid
type CreateProjectItemRequest ¶
type CreateProjectItemRequest struct {
Title string `json:"title"`
}
type CreateProjectRequest ¶
type CreateProjectRequest struct {
StoreID string `json:"store"`
// ID is the id of the project to create. It is supplied by the caller,
// never derived from the title: it addresses the project for the rest of
// its life — a key segment, and a directory name under a file-backed
// store — so the caller, not the storage, owns it. See
// ValidateProjectID for the rules it must satisfy.
ID string `json:"id"`
Title string `json:"title"`
}
CreateProjectRequest request
func (CreateProjectRequest) Validate ¶
func (v CreateProjectRequest) Validate() error
type CreateQuery ¶
type CreateQuery struct {
ProjectRef
Folder string `json:"folder"`
Query datatug.QueryDefWithFolderPath `json:"query"`
}
type GetServerDatabasesRequest ¶
type GetServerDatabasesRequest struct {
Project string `json:"proj"`
Environment string `json:"env"`
datatug.ServerRef
Credentials *datatug.Credentials `json:"credentials"`
}
GetServerDatabasesRequest input for /dbserver/databases API
func (GetServerDatabasesRequest) Validate ¶
func (v GetServerDatabasesRequest) Validate() error
Validate returns error if not valid
type ProjRecordsetSummary ¶
type ProjRecordsetSummary struct {
datatug.ProjectItem
Columns []string `json:"columns,omitempty"`
Recordsets []*ProjRecordsetSummary `json:"recordsets,omitempty"`
}
ProjRecordsetSummary holds summary info about recordset definition
type ProjectItemRef ¶
type ProjectItemRef struct {
ProjectRef
ID string
}
ProjectItemRef holds ProjectRef & ID parameters
func (ProjectItemRef) Validate ¶
func (v ProjectItemRef) Validate() error
Validate returns error if not valid
type ProjectRef ¶
ProjectRef holds storage & project parameters
func (ProjectRef) Validate ¶
func (v ProjectRef) Validate() error
Validate returns error if not valid
type UpdateQuery ¶
type UpdateQuery struct {
ProjectItemRef
Query datatug.QueryDefWithFolderPath `json:"query"`
}