Skip to content

Loading…

add DeleteMsg() to Queue #9

Merged
merged 1 commit into from

2 participants

@coopernurse

No description provided.

@edsrzf edsrzf merged commit eff3b33 into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 6, 2012
  1. @coopernurse

    add DeleteMsg() to Queue

    coopernurse committed
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)
}
Something went wrong with that request. Please try again.