eventarc

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package eventarc provides an in-memory mock implementation of GCP Eventarc.

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 GCP Eventarc.

func New

func New(opts *config.Options) *Mock

New creates a new Eventarc 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 Eventarc channel.

func (*Mock) DeleteEventBus

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

DeleteEventBus deletes an Eventarc channel.

func (*Mock) DeleteRule

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

DeleteRule deletes a trigger from a channel.

func (*Mock) DisableRule

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

DisableRule disables a trigger on a channel.

func (*Mock) EnableRule

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

EnableRule enables a trigger on a channel.

func (*Mock) GetEventBus

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

GetEventBus retrieves information about an Eventarc channel.

func (*Mock) GetEventHistory

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

GetEventHistory retrieves event history for a channel.

func (*Mock) GetRule

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

GetRule retrieves a trigger from a channel.

func (*Mock) ListEventBuses

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

ListEventBuses lists all Eventarc channels.

func (*Mock) ListRules

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

ListRules lists all triggers on a channel.

func (*Mock) ListTargets

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

ListTargets lists all targets for a trigger.

func (*Mock) MatchedRules

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

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

func (*Mock) PutEvents

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

PutEvents publishes events to Eventarc channels.

func (*Mock) PutRule

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

PutRule creates or updates a trigger on a channel.

func (*Mock) PutTargets

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

PutTargets adds targets to a trigger.

func (*Mock) RemoveTargets

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

RemoveTargets removes targets from a trigger.

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