eventprocessor

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEventSendingFailed = errors.New("failed to send event")

	ErrNoPreviousEvent  = errors.New("no previous events found for selected item")
	ErrSystemProcessing = errors.New("system is still in processing state")

	ErrMissingKeyID = errors.New("keyID is required to create key event job")
)
View Source
var (
	ErrTargetNotConfigured       = errors.New("target not configured for region")
	ErrUnsupportedTaskType       = errors.New("unsupported task type")
	ErrKeyAccessMetadataNotFound = errors.New("key access metadata not found for system region")
	ErrPluginNotFound            = errors.New("plugin not found for key provider")
	ErrSettingKeyClaim           = errors.New("error setting key claim for system")
	ErrUnsupportedRegion         = errors.New("unsupported region")
	ErrNoConnectedRegionsForKey  = errors.New("no connected regions found for key")
)

Functions

This section is empty.

Types

type CryptoReconciler

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

CryptoReconciler is responsible for handling orbital jobs and managing the lifecycle of systems in CMK.

func NewCryptoReconciler

func NewCryptoReconciler(
	ctx context.Context,
	cfg *config.Config,
	repository repo.Repo,
	svcRegistry *cmkpluginregistry.Registry,
	clientsFactory clients.Factory,
	opts ...Option,
) (*CryptoReconciler, error)

NewCryptoReconciler creates a new CryptoReconciler instance.

func (*CryptoReconciler) CloseAmqpClients

func (c *CryptoReconciler) CloseAmqpClients(ctx context.Context)

func (*CryptoReconciler) Start

func (c *CryptoReconciler) Start(ctx context.Context) error

Start starts the orbital manager.

type Event

type Event struct {
	Name  string
	Event func(ctx context.Context) (orbital.Job, error)
}

type EventFactory added in v0.3.0

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

func NewEventFactory added in v0.3.0

func NewEventFactory(
	ctx context.Context,
	cfg *config.Config,
	repository repo.Repo,
) (*EventFactory, error)

func (*EventFactory) CreateJob added in v0.3.0

func (f *EventFactory) CreateJob(ctx context.Context, event *model.Event) (orbital.Job, error)

func (*EventFactory) GetLastEvent added in v0.3.0

func (f *EventFactory) GetLastEvent(
	ctx context.Context,
	cmkItemID string,
) (*model.Event, error)

GetLastEvent returns the last event of an item

func (*EventFactory) KeyDetach added in v0.3.0

func (f *EventFactory) KeyDetach(ctx context.Context, keyID string) (orbital.Job, error)

KeyDetach creates a job to detach a key. Context provided must have the tenant set.

func (*EventFactory) KeyDisable added in v0.3.0

func (f *EventFactory) KeyDisable(ctx context.Context, keyID string) (orbital.Job, error)

KeyDisable creates a job to disable a key make sure the ctx provided has the tenant set.

func (*EventFactory) KeyEnable added in v0.3.0

func (f *EventFactory) KeyEnable(ctx context.Context, keyID string) (orbital.Job, error)

KeyEnable creates a job to enable a key make sure the ctx provided has the tenant set.

func (*EventFactory) SendEvent added in v0.3.0

func (f *EventFactory) SendEvent(ctx context.Context, event Event) error
func (f *EventFactory) SystemLink(ctx context.Context, system *model.System, keyID string) (orbital.Job, error)

SystemLink creates a job to link a system with a key make sure the ctx provided has the tenant set.

func (*EventFactory) SystemSwitch added in v0.3.0

func (f *EventFactory) SystemSwitch(
	ctx context.Context,
	system *model.System,
	keyIDTo string,
	keyIDFrom string,
	trigger string,
) (orbital.Job, error)

SystemSwitch creates a job to switch the key of a system from keyIDFrom to keyIDTo make sure the ctx provided has the tenant set. trigger can be KeyActionSetPrimary to indicate this switch is from a make primary key action

func (f *EventFactory) SystemUnlink(
	ctx context.Context,
	system *model.System,
	keyID string,
	trigger string,
) (orbital.Job, error)

SystemUnlink creates a job to unlink a system from a key make sure the ctx provided has the tenant set.

type KeyActionJobData

type KeyActionJobData struct {
	TenantID string `json:"tenantID"`
	KeyID    string `json:"keyID"`
}

KeyActionJobData contains the data needed for a key action orbital job.

type Option

type Option func(manager *orbital.Manager)

func WithConfirmJobAfter

func WithConfirmJobAfter(d time.Duration) Option

func WithExecInterval

func WithExecInterval(d time.Duration) Option

func WithMaxReconcileCount

func WithMaxReconcileCount(n uint64) Option

type SystemActionJobData

type SystemActionJobData struct {
	SystemID  string `json:"systemID"`
	TenantID  string `json:"tenantID"`
	KeyIDTo   string `json:"keyIDTo"`
	KeyIDFrom string `json:"keyIDFrom"`
	Trigger   string `json:"trigger,omitempty"`
}

SystemActionJobData contains the data needed for a system action orbital job.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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