mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
@@ -29,6 +29,7 @@ type Route struct {
|
||||
Path string `json:"path" db:"path"`
|
||||
Image string `json:"image" db:"image"`
|
||||
Memory uint64 `json:"memory" db:"memory"`
|
||||
CPUs MilliCPUs `json:"cpus" db:"cpus"`
|
||||
Headers Headers `json:"headers,omitempty" db:"headers"`
|
||||
Type string `json:"type" db:"type"`
|
||||
Format string `json:"format" db:"format"`
|
||||
@@ -161,6 +162,7 @@ func (r1 *Route) Equals(r2 *Route) bool {
|
||||
eq = eq && r1.Path == r2.Path
|
||||
eq = eq && r1.Image == r2.Image
|
||||
eq = eq && r1.Memory == r2.Memory
|
||||
eq = eq && r1.CPUs == r2.CPUs
|
||||
eq = eq && r1.Headers.Equals(r2.Headers)
|
||||
eq = eq && r1.Type == r2.Type
|
||||
eq = eq && r1.Format == r2.Format
|
||||
@@ -186,6 +188,9 @@ func (r *Route) Update(new *Route) {
|
||||
if new.Memory != 0 {
|
||||
r.Memory = new.Memory
|
||||
}
|
||||
if new.CPUs != 0 {
|
||||
r.CPUs = new.CPUs
|
||||
}
|
||||
if new.Type != "" {
|
||||
r.Type = new.Type
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user