eventgrid

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package eventgrid provides an in-memory mock implementation of Azure Event Grid.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock is an in-memory mock implementation of Azure Event Grid.

func New

func New(opts *config.Options) *Mock

New creates a new Event Grid mock with the given configuration options.

func (*Mock) CreateEventBus

func (m *Mock) CreateEventBus(_ context.Context, cfg driver.EventBusConfig) (*driver.EventBusInfo, error)

CreateEventBus creates a new Event Grid topic.

func (*Mock) DeleteEventBus

func (m *Mock) DeleteEventBus(_ context.Context, name string) error

DeleteEventBus deletes an Event Grid topic.

func (*Mock) DeleteRule

func (m *Mock) DeleteRule(_ context.Context, eventBus, ruleName string) error

DeleteRule deletes an event subscription from a topic.

func (*Mock) DisableRule

func (m *Mock) DisableRule(_ context.Context, eventBus, ruleName string) error

DisableRule disables an event subscription on a topic.

func (*Mock) EnableRule

func (m *Mock) EnableRule(_ context.Context, eventBus, ruleName string) error

EnableRule enables an event subscription on a topic.

func (*Mock) GetEventBus

func (m *Mock) GetEventBus(_ context.Context, name string) (*driver.EventBusInfo, error)

GetEventBus retrieves information about an Event Grid topic.

func (*Mock) GetEventHistory

func (m *Mock) GetEventHistory(_ context.Context, eventBus string, limit int) ([]driver.Event, error)

GetEventHistory retrieves event history for a topic.

func (*Mock) GetRule

func (m *Mock) GetRule(_ context.Context, eventBus, ruleName string) (*driver.Rule, error)

GetRule retrieves an event subscription from a topic.

func (*Mock) ListEventBuses

func (m *Mock) ListEventBuses(_ context.Context) ([]driver.EventBusInfo, error)

ListEventBuses lists all Event Grid topics.

func (*Mock) ListRules

func (m *Mock) ListRules(_ context.Context, eventBus string) ([]driver.Rule, error)

ListRules lists all event subscriptions on a topic.

func (*Mock) ListTargets

func (m *Mock) ListTargets(_ context.Context, eventBus, ruleName string) ([]driver.Target, error)

ListTargets lists all targets for an event subscription.

func (*Mock) MatchedRules

func (m *Mock) MatchedRules(event *driver.Event) []driver.Rule

MatchedRules returns all subscriptions that match the given event (exported for testing).

func (*Mock) PutEvents

func (m *Mock) PutEvents(_ context.Context, events []driver.Event) (*driver.PublishResult, error)

PutEvents publishes events to Event Grid topics.

func (*Mock) PutRule

func (m *Mock) PutRule(_ context.Context, cfg *driver.RuleConfig) (*driver.Rule, error)

PutRule creates or updates an event subscription on a topic.

func (*Mock) PutTargets

func (m *Mock) PutTargets(_ context.Context, eventBus, ruleName string, targets []driver.Target) error

PutTargets adds targets to an event subscription.

func (*Mock) RemoveTargets

func (m *Mock) RemoveTargets(_ context.Context, eventBus, ruleName string, targetIDs []string) error

RemoveTargets removes targets from an event subscription.

func (*Mock) SetMonitoring

func (m *Mock) SetMonitoring(mon mondriver.Monitoring)

SetMonitoring sets the monitoring backend for auto-metric generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL