events

package
v1.3.0-test Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	CreateEvent(ctx context.Context, orgId uuid.UUID, event *domain.Event)
	HandleGenericResourceDeletedEvents(ctx context.Context, resourceKind domain.ResourceKind, orgId uuid.UUID, name string, oldResource, newResource interface{}, created bool, err error)
}

Service is the generic events-emission core. It intentionally holds only the logic that makes no per-resource decisions: writing an event record, and emitting the generic "resource deleted" event (which needs nothing resource-specific beyond a kind and name). Every resource-specific event decision (what changed, which condition flipped, which message applies) lives in that resource's own internal/service/{resource} package, which calls back into this interface only for these generic parts. This keeps Service from becoming a hub every resource package must depend on for domain-specific logic.

type ServiceHandler

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

func NewServiceHandler

func NewServiceHandler(store eventstore.Store, workerClient worker_client.WorkerClient, log logrus.FieldLogger) *ServiceHandler

NewServiceHandler creates a new events ServiceHandler instance.

func (*ServiceHandler) CreateEvent

func (h *ServiceHandler) CreateEvent(ctx context.Context, orgId uuid.UUID, event *domain.Event)

CreateEvent creates an event in the store

func (*ServiceHandler) HandleGenericResourceDeletedEvents

func (h *ServiceHandler) HandleGenericResourceDeletedEvents(ctx context.Context, resourceKind domain.ResourceKind, orgId uuid.UUID, name string, _, _ interface{}, created bool, err error)

HandleGenericResourceDeletedEvents handles generic resource deletion event emission logic

Jump to

Keyboard shortcuts

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