Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrSubscriptionRequired = fmt.Errorf("A subscription is required for Service Bus Topic operations")
)
ErrSubscriptionRequired is raised when a service bus topics operations is performed without a subscription.
Functions ¶
This section is empty.
Types ¶
type AzEventHubConfiguration ¶
type AzEventHubConfiguration struct {
// contains filtered or unexported fields
}
type BatchMessage ¶
type BatchMessage struct {
Body string `json:"Body"`
}
type ClientType ¶
type ClientType int
ClientType denotes the type of client (topic/queue) that is required
const ( //Queue is a client type for Azure Service Bus queues Queue ClientType = iota //Topic is a client type for Azure Service Bus topics Topic ClientType = iota )
type EventHubClient ¶
type EventHubClient interface { DeleteMessage(item *Message) error PeekLockMessage(path string, timeout int) (*Message, error) CreateEventHub(path string) error Send(path string, item *Message) error SendBatch(path string, items []*BatchMessage) error SetSubscription(subscription string) }
EventHubClient is a client for Azure Service Bus (queues and topics). You should use a different client instance for every namespace. For more comprehensive documentation on its various methods, see:
https://msdn.microsoft.com/en-us/library/azure/hh780717.aspx
func NewEventHubClient ¶
func NewEventHubClient(clientType ClientType, namespace string, sharedAccessKeyName string, sharedAccessKeyValue string) EventHubClient
NewEventHubClient creates a new client from the given parameters. Their meaning can be found in the MSDN docs at:
https://docs.microsoft.com/en-us/rest/api/servicebus/Introduction
func NewEventHubClientFromConfig ¶
func NewEventHubClientFromConfig(clientType ClientType, config AzEventHubConfiguration) EventHubClient
NewEventHubClientFromConfig creates a new client from the given parameters. Their meaning can be found in the MSDN docs at:
https://docs.microsoft.com/en-us/rest/api/servicebus/Introduction
type FakeEventHubClient ¶
type FakeEventHubClient struct { }
func (*FakeEventHubClient) CreateEventHub ¶
func (c *FakeEventHubClient) CreateEventHub(path string) error
func (*FakeEventHubClient) Send ¶
func (c *FakeEventHubClient) Send(path string, item *Message) error
func (*FakeEventHubClient) SendBatch ¶
func (c *FakeEventHubClient) SendBatch(path string, items []*BatchMessage) error
type Message ¶
type Message struct { DeliveryCount int EnqueuedSequenceNumber int EnqueuedTimeUtc Time LockToken string LockedUntilUtc Time MessageID string `json:"MessageId"` PartitionKey string SequenceNumber int State string TimeToLive int Location string Body []byte }
Message is an Azure Service Bus message
type Time ¶
Time is a wrapper round time.Time to json encode/decode in RFC1123 fomat
func (*Time) UnmarshalJSON ¶
UnmarshalJSON from RFC1123