Browse files

add DeleteMsg() to Queue

  • Loading branch information...
1 parent 7306a6b commit 986a3e71df9e99b1bb6c11770d7e5d7e20f1737c @coopernurse coopernurse committed Mar 6, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 ironmq.go
View
6 ironmq.go
@@ -195,6 +195,10 @@ func (q *Queue) PushMsg(msg *Message) (id string, err error) {
return resp.IDs[0], nil
}
+func (q *Queue) DeleteMsg(id string) error {
+ return q.Client.req("DELETE", "queues/"+q.Name+"/messages/"+id, nil, nil)
+}
+
type Message struct {
Id string `json:"id,omitempty"`
Body string `json:"body"`
@@ -208,5 +212,5 @@ type Message struct {
}
func (m *Message) Delete() error {
- return m.q.Client.req("DELETE", "queues/"+m.q.Name+"/messages/"+m.Id, nil, nil)
+ return m.q.DeleteMsg(m.Id)
}

0 comments on commit 986a3e7

Please sign in to comment.