reconcilers

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package reconcilers contains the reconcilers for the various types of entities in mediator.

Index

Constants

View Source
const (
	// InternalReconcilerEventTopic is the topic for internal reconciler events
	InternalReconcilerEventTopic = "internal.repo.reconciler.event"
	// InternalPolicyInitEventTopic is the topic for internal init events
	InternalPolicyInitEventTopic = "internal.policy.init.event"
)

Variables

View Source
var CONTAINER_TYPE = "container"

CONTAINER_TYPE is the type for container artifacts

Functions

func NewPolicyInitMessage

func NewPolicyInitMessage(provider string, projectID uuid.UUID) (*message.Message, error)

NewPolicyInitMessage creates a new repos init event

func NewRepoReconcilerMessage

func NewRepoReconcilerMessage(provider string, repoID int32, projectID uuid.UUID) (*message.Message, error)

NewRepoReconcilerMessage creates a new repos init event

Types

type PolicyInitEvent

type PolicyInitEvent struct {
	// Project is the project that the event is relevant to
	Project uuid.UUID `json:"project" validate:"gte=0"`
}

PolicyInitEvent is an event that is sent to the reconciler topic when a new policy is created. It is used to initialize the policy by iterating over all registered entities for the relevant group and sending a policy evaluation event for each one.

type Reconciler

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

Reconciler is a helper that reconciles entities

func NewReconciler

func NewReconciler(store db.Store, evt *events.Eventer, authCfg *config.AuthConfig) (*Reconciler, error)

NewReconciler creates a new reconciler object

func (*Reconciler) Register

func (e *Reconciler) Register(r events.Registrar)

Register implements the Consumer interface.

type RepoReconcilerEvent

type RepoReconcilerEvent struct {
	// Project is the group that the event is relevant to
	Project uuid.UUID `json:"group" validate:"gte=0"`
	// Repository is the repository to be reconciled
	Repository int32 `json:"repository" validate:"gte=0"`
}

RepoReconcilerEvent is an event that is sent to the reconciler topic

Jump to

Keyboard shortcuts

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