Documentation
¶
Overview ¶
Package queue emulates Azure Queue Storage on Azurite's port (10001): queues with metadata and access policies, and messages with visibility timeouts, TTLs, pop receipts, peek, update and clear. Connect with a connection string whose QueueEndpoint is http://127.0.0.1:10001/devstoreaccount1. Shared Key and SAS are accepted without signature checks.
Index ¶
- Constants
- type Account
- type Message
- type Queue
- type Service
- func (s *Service) DropAccount(name string)
- func (s *Service) Info() core.Info
- func (s *Service) Inspect(table, id string) any
- func (s *Service) Load(b []byte) error
- func (s *Service) Peek(account, queue string, max int) []Message
- func (s *Service) Port() int
- func (s *Service) Reset()
- func (s *Service) Resources() []core.Table
- func (s *Service) Save() ([]byte, error)
- func (s *Service) Send(account, queue, text string) error
- func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
const Port = 10001
Port is Azurite's queue port.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
Queues map[string]*Queue `json:"queues"`
Props string `json:"props,omitempty"` // service properties XML
}
Account is a storage account (devstoreaccount1 by default).
type Message ¶
type Message struct {
ID string `json:"id"`
Text string `json:"text"`
Inserted time.Time `json:"inserted"`
Expires time.Time `json:"expires"`
NextVisible time.Time `json:"nextVisible"`
DequeueCount int64 `json:"dequeueCount"`
PopReceipt string `json:"popReceipt"`
}
Message is a queue message.
type Queue ¶
type Queue struct {
Name string `json:"name"`
Meta map[string]string `json:"meta,omitempty"`
ACL string `json:"acl,omitempty"` // SignedIdentifiers XML
Messages []*Message `json:"messages"`
}
Queue holds messages in arrival order. ponytail: operations scan the slice; index by id if queues get deep.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Queue Storage emulator.
func (*Service) DropAccount ¶
DropAccount forgets a storage account's queues; the blob package calls it when the account is deleted.
func (*Service) Inspect ¶
Inspect returns a queue's metadata and a peek at its first 20 visible messages.