Ejemplo n.º 1
0
//gomodel insertMessageSQL = [
//  INSERT INTO message(Id, Value, Timing) VALUES(?, ?, ?)
//]
func (d *DB) Put(id, value string, expires time.Duration) error {
	_, err := gomodel.Update(d.stmtInsert, nil, id, value, d.timingString(expires))
	return err
}
Ejemplo n.º 2
0
//gomodel deleteMessageByIdSQL = [
//  DELETE FROM message WHERE Id=?
//]
func (d *DB) Delete(id string) error {
	c, err := gomodel.Update(d.stmtDeleteById, nil, id)

	return dberrs.NoAffects(c, err, gotmsq.ErrNoMessage)
}