$ go get -u github.com/g-rad/go-azurequeue
or if you use dep, within your repo run:
$ dep ensure -add github.com/g-rad/go-azurequeue
If you need to install Go, follow the official instructions.
import queue "github.com/g-rad/go-azurequeue"
cli := queue.QueueClient{
Namespace: "my-test",
KeyName: "RootManageSharedAccessKey",
KeyValue: "ErCWbtgArb55Tqqu9tXgdCtopbZ44pMH01sjpMrYGrE=",
QueueName: "my-queue",
Timeout: 60,
}
// create message
msg := queue.NewMessage(]byte("Hello!"))
msg.Properties.Set("Property1", "Value1")
msg.Properties.Set("Property2", "Value2")
// send message
cli.SendMessage(&msg)
msg, err := cli.GetMessage()
If you failed to process a message, unlock it for processing by other receivers.
cli.UnlockMessage(&msg)
This operation completes the processing of a locked message and deletes it from the queue.
cli.DeleteMessage(&msg)