Skip to content

azqlite is a lightweight wrapper around Azure's SDK to interact with the Azure Storage Queue service in a simpler and more idiomatic way.

License

Notifications You must be signed in to change notification settings

josebalius/azqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

azqlite Go Reference

azqlite is a lightweight wrapper around github.com/Azure/azure-storage-queue-go to interact with the Azure Storage Queue service in a simpler and more idiomatic way.

Install

go get github.com/josebalius/azqlite

How to use

Instantiate a service

client, err := azqlite.NewClient(azqlite.Config{
	AccountName: "YOUR_AZURE_STORAGE_ACCOUNT_NAME_HERE",
	AccountKey:  "YOUR_AZURE_STORAGE_ACCOUNT_KEY_HERE",
})

Create a queue

q, err := client.CreateQueue(ctx, "test")

Delete a queue

err = c.DeleteQueue(ctx, "test")

Get an existing queue

q := c.GetQueue("test")

Get message count

c, err := q.MessageCount(ctx)

Enqueue a message

m, err := q.Enqueue(ctx, "my message", 1*time.Second, -time.Second)

Dequeue messages

messages, err := q.Dequeue(ctx, 30, 1*time.Second)

Peek messages

messages, err := q.Peek(ctx, 30)

Delete a message

err := q.Delete(ctx, &Message{ID: "1"})

About

azqlite is a lightweight wrapper around Azure's SDK to interact with the Azure Storage Queue service in a simpler and more idiomatic way.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages