Example #1
0
// PutUser saves a user in the datastore.
func (db *Userstore) PutUser(user *model.User) error {
	if user.Created == 0 {
		user.Created = time.Now().UTC().Unix()
	}
	user.Updated = time.Now().UTC().Unix()
	return meddler.Save(db, userTable, user)
}
Example #2
0
// PostUser saves a User in the datastore.
func (db *Userstore) PostUser(user *model.User) error {
	user.Created = time.Now().UTC().Unix()
	user.Updated = time.Now().UTC().Unix()
	return meddler.Insert(db, userTable, user)
}