reconcilers

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

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

Index

Constants

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

Variables

View Source
var (
	// ArtifactTypeContainerRetentionPeriod represents the retention period for container artifacts
	ArtifactTypeContainerRetentionPeriod = time.Now().AddDate(0, -6, 0)
)

Functions

func NewProfileInitMessage

func NewProfileInitMessage(projectID uuid.UUID) (*message.Message, error)

NewProfileInitMessage creates a new repos init event

func NewRepoReconcilerMessage

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

NewRepoReconcilerMessage creates a new repos init event

Types

type ProfileInitEvent

type ProfileInitEvent struct {
	// Project is the project that the event is relevant to
	Project uuid.UUID `json:"project"`
}

ProfileInitEvent is an event that is sent to the reconciler topic when a new profile is created. It is used to initialize the profile by iterating over all registered entities for the relevant project and sending a profile 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.Publisher,
	authCfg *serverconfig.AuthConfig,
	provCfg *serverconfig.ProviderConfig,
	opts ...ReconcilerOption,
) (*Reconciler, error)

NewReconciler creates a new reconciler object

func (*Reconciler) Register

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

Register implements the Consumer interface.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is a function that modifies a reconciler

func WithProviderMetrics

func WithProviderMetrics(mt providertelemetry.ProviderMetrics) ReconcilerOption

WithProviderMetrics sets the provider metrics for the reconciler

func WithRestClientCache added in v0.0.31

func WithRestClientCache(cache ratecache.RestClientCache) ReconcilerOption

WithRestClientCache sets the rest client cache for the reconciler

type RepoReconcilerEvent

type RepoReconcilerEvent struct {
	// Project is the project that the event is relevant to
	Project uuid.UUID `json:"project"`
	// Repository is the repository to be reconciled
	Repository int64 `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