events

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 11 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

Overview

Package events is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockService added in v1.4.0

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

MockService is a mock of Service interface.

func NewMockService added in v1.4.0

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance.

func (*MockService) CreateEvent added in v1.4.0

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

CreateEvent mocks base method.

func (*MockService) EXPECT added in v1.4.0

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockService) HandleGenericResourceDeletedEvents added in v1.4.0

func (m *MockService) HandleGenericResourceDeletedEvents(ctx context.Context, resourceKind domain.ResourceKind, orgId uuid.UUID, name string, oldResource, newResource any, created bool, err error)

HandleGenericResourceDeletedEvents mocks base method.

type MockServiceMockRecorder added in v1.4.0

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

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) CreateEvent added in v1.4.0

func (mr *MockServiceMockRecorder) CreateEvent(ctx, orgId, event any) *gomock.Call

CreateEvent indicates an expected call of CreateEvent.

func (*MockServiceMockRecorder) HandleGenericResourceDeletedEvents added in v1.4.0

func (mr *MockServiceMockRecorder) HandleGenericResourceDeletedEvents(ctx, resourceKind, orgId, name, oldResource, newResource, created, err any) *gomock.Call

HandleGenericResourceDeletedEvents indicates an expected call of HandleGenericResourceDeletedEvents.

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) CreateEventWithRetry added in v1.4.0

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

CreateEventWithRetry persists an event and retries queue publication when a concrete worker client exposes publication errors. It is used by the standalone-device PrepareDeltas path, whose delayed render must not depend on a single transient queue write.

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

func (*ServiceHandler) SetWorkerClient added in v1.4.0

func (h *ServiceHandler) SetWorkerClient(workerClient worker_client.WorkerClient)

SetWorkerClient wires the queue publisher after construction. Some workers construct their resource services before opening queue producers; keeping this setter on the concrete handler lets them enable event fan-out once the producer lifecycle is established.

Jump to

Keyboard shortcuts

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