mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: Add basic support for rich parameters to coderd and provisionerd (#5710)
This commit is contained in:
@ -612,6 +612,30 @@ type TemplateVersion struct {
|
||||
CreatedBy uuid.UUID `db:"created_by" json:"created_by"`
|
||||
}
|
||||
|
||||
type TemplateVersionParameter struct {
|
||||
TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"`
|
||||
// Parameter name
|
||||
Name string `db:"name" json:"name"`
|
||||
// Parameter description
|
||||
Description string `db:"description" json:"description"`
|
||||
// Parameter type
|
||||
Type string `db:"type" json:"type"`
|
||||
// Is parameter mutable?
|
||||
Mutable bool `db:"mutable" json:"mutable"`
|
||||
// Default value
|
||||
DefaultValue string `db:"default_value" json:"default_value"`
|
||||
// Icon
|
||||
Icon string `db:"icon" json:"icon"`
|
||||
// Additional options
|
||||
Options json.RawMessage `db:"options" json:"options"`
|
||||
// Validation: regex pattern
|
||||
ValidationRegex string `db:"validation_regex" json:"validation_regex"`
|
||||
// Validation: minimum length of value
|
||||
ValidationMin int32 `db:"validation_min" json:"validation_min"`
|
||||
// Validation: maximum length of value
|
||||
ValidationMax int32 `db:"validation_max" json:"validation_max"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
Email string `db:"email" json:"email"`
|
||||
@ -713,6 +737,14 @@ type WorkspaceBuild struct {
|
||||
DailyCost int32 `db:"daily_cost" json:"daily_cost"`
|
||||
}
|
||||
|
||||
type WorkspaceBuildParameter struct {
|
||||
WorkspaceBuildID uuid.UUID `db:"workspace_build_id" json:"workspace_build_id"`
|
||||
// Parameter name
|
||||
Name string `db:"name" json:"name"`
|
||||
// Parameter value
|
||||
Value string `db:"value" json:"value"`
|
||||
}
|
||||
|
||||
type WorkspaceResource struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
|
Reference in New Issue
Block a user