Checking ifModifiedSince param

This commit is contained in:
Deluan
2016-03-01 16:05:49 -05:00
parent 841d8f457f
commit b8948c417e
5 changed files with 88 additions and 22 deletions
+11
View File
@@ -8,6 +8,7 @@ import (
type Property interface {
Put(id string, value string) error
Get(id string) (string, error)
DefaultGet(id string, defaultValue string) (string, error)
}
type PropertyImpl struct {
@@ -33,3 +34,13 @@ func (r *PropertyImpl) Get(id string) (string, error) {
rec, err := r.readEntity(id)
return rec.(*models.Property).Value, err
}
func (r* PropertyImpl) DefaultGet(id string, defaultValue string) (string, error) {
v, err := r.Get(id)
if v == "" {
v = defaultValue
}
return v, err
}