mirror of
https://github.com/railwayapp/cli
synced 2026-04-21 14:07:23 +00:00
* Introduce optional replace semantics for variables set as an alternative to upsert * Add a safety prompt for replace and a flag to skip it * Update wordings, simplify function signature and add comment to warn about destructive query
49 lines
807 B
Go
49 lines
807 B
Go
package entity
|
|
|
|
type GetEnvsRequest struct {
|
|
ProjectID string
|
|
EnvironmentID string
|
|
ServiceID string
|
|
}
|
|
|
|
type GetEnvsForPluginRequest struct {
|
|
ProjectID string
|
|
EnvironmentID string
|
|
PluginID string
|
|
}
|
|
|
|
type UpdateEnvsRequest struct {
|
|
ProjectID string
|
|
EnvironmentID string
|
|
PluginID string
|
|
ServiceID string
|
|
Envs *Envs
|
|
Replace bool
|
|
}
|
|
|
|
type DeleteVariableRequest struct {
|
|
ProjectID string
|
|
EnvironmentID string
|
|
PluginID string
|
|
ServiceID string
|
|
Name string
|
|
}
|
|
|
|
type Envs map[string]string
|
|
|
|
func (e Envs) Get(name string) string {
|
|
return e[name]
|
|
}
|
|
|
|
func (e Envs) Set(name, value string) {
|
|
e[name] = value
|
|
}
|
|
|
|
func (e Envs) Has(name string) bool {
|
|
_, ok := e[name]
|
|
return ok
|
|
}
|
|
|
|
func (e Envs) Delete(name string) {
|
|
delete(e, name)
|
|
}
|