Documentation ¶
Index ¶
- type Notifications
- func (n Notifications) Ctx() context.Context
- func (n Notifications) DataCount() int
- func (n Notifications) GetPublisherInfo() string
- func (n Notifications) Promise(ctx context.Context) error
- func (n Notifications) Recycle()
- func (n Notifications) SendEvent(hc *http.Client, store *storage.Client) (err error)
- func (n Notifications) SendPromise(e error, backupCh chan error)
- func (n Notifications) SetCtx(ctx context.Context) models.Notifications
- func (n Notifications) SetPromise(promise chan error) models.Notifications
- func (n Notifications) Version() version.Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notifications ¶
type Notifications struct { // ResourceLocation is the location of the resources in this notification. This is the normalized ARM location enum // like "eastus". ResourceLocation string // FrontdoorLocation is the ARM region that emitted the notification. Omitted for notifications not emitted by ARM. FrontdoorLocation string // PublisherInfo is the Namespace of the publisher sending the data of this notification, for example Microsoft.Resources is be the publisherInfo for ARM. PublisherInfo string // AdditionalBatchProperties can contain the sdkversion, batchsize, subscription partition tag etc. AdditionalBatchProperties types.AdditionalBatchProperties // Data is the data to send in the notification. Data []types.NotificationResource // contains filtered or unexported fields }
Notifications is a notification to send to the ARN service. This is a wrapper around the actual data that is sent in the notification described in types.Data. The data will be converted to an Event and sent over the wire.
func (Notifications) Ctx ¶
func (n Notifications) Ctx() context.Context
func (Notifications) DataCount ¶
func (n Notifications) DataCount() int
DataCount implements models.Notifications.DataCount().
func (Notifications) GetPublisherInfo ¶ added in v0.1.2
func (n Notifications) GetPublisherInfo() string
GetPublisherInfo implements models.Notifications.GetPublisherInfo().
func (Notifications) Promise ¶
func (n Notifications) Promise(ctx context.Context) error
Promise waits for the promise to be fulfilled. This will return an ErrPromiseTimeout if the context passed times out to distiguish it from a context timeout on sending the notification.
func (Notifications) Recycle ¶
func (n Notifications) Recycle()
Recycle can be used to recycle the promise of a notification once it has been used. This is for internal use and should not be called. It is a terrible idea to use the promise after it has been recycled.
func (Notifications) SendEvent ¶
SendEvent converts the notification to an event and sends it to the ARN service. Do not call this function directly, use methods on the Client instead.
func (Notifications) SendPromise ¶
func (n Notifications) SendPromise(e error, backupCh chan error)
SendPromise sends an error on the promise to the notification.
func (Notifications) SetCtx ¶
func (n Notifications) SetCtx(ctx context.Context) models.Notifications
SetCtx implements models.Notifications.SetCtx().
func (Notifications) SetPromise ¶
func (n Notifications) SetPromise(promise chan error) models.Notifications
SetPromise sets the promise channel used for the notification.
func (Notifications) Version ¶
func (n Notifications) Version() version.Schema
DataJSON implements models.Notifications.Version().