mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Timestamps on apps / routes (#614)
* route updated_at * add app created at, fix some route updated_at bugs * add app updated_at TODO need to add tests through front end TODO for validation we don't really want to use the validate wrapper since it's a programmer error and not a user error, hopefully tests block this. * add tests for timestamps to exist / change on apps&routes * route equals at done, fix tests wit dis * fix up the equals sugar * add swagger * fix rebase * precisely allocate maps in clone * vetted * meh * fix api tests
This commit is contained in:
@@ -14,6 +14,19 @@ func (c *Config) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c1 Config) Equals(c2 Config) bool {
|
||||
if len(c1) != len(c2) {
|
||||
return false
|
||||
}
|
||||
for k1, v1 := range c1 {
|
||||
v2, _ := c2[k1]
|
||||
if v1 != v2 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// implements sql.Valuer, returning a string
|
||||
func (c Config) Value() (driver.Value, error) {
|
||||
if len(c) < 1 {
|
||||
@@ -56,6 +69,24 @@ func (c *Config) Scan(value interface{}) error {
|
||||
// Headers is an http.Header that implements additional methods.
|
||||
type Headers http.Header
|
||||
|
||||
func (h1 Headers) Equals(h2 Headers) bool {
|
||||
if len(h1) != len(h2) {
|
||||
return false
|
||||
}
|
||||
for k1, v1s := range h1 {
|
||||
v2s, _ := h2[k1]
|
||||
if len(v2s) != len(v1s) {
|
||||
return false
|
||||
}
|
||||
for i, v1 := range v1s {
|
||||
if v2s[i] != v1 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// implements sql.Valuer, returning a string
|
||||
func (h Headers) Value() (driver.Value, error) {
|
||||
if len(h) < 1 {
|
||||
|
||||
Reference in New Issue
Block a user