Documentation
¶
Overview ¶
Package messages contains messages structs and builders for events handled by reconcilers.
Index ¶
- func NewRepoReconcilerMessage(providerID uuid.UUID, entityID uuid.UUID, projectID uuid.UUID) (*message.Message, error)
- type CoreContext
- type MinderEvent
- func (e *MinderEvent) ToMessage(msg *message.Message) error
- func (e *MinderEvent) WithEntityID(entityID uuid.UUID) *MinderEvent
- func (e *MinderEvent) WithEntityType(entityType minderv1.Entity) *MinderEvent
- func (e *MinderEvent) WithProjectID(projectID uuid.UUID) *MinderEvent
- func (e *MinderEvent) WithProperties(props *properties.Properties) *MinderEvent
- func (e *MinderEvent) WithProviderID(providerID uuid.UUID) *MinderEvent
- type RepoReconcilerEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CoreContext ¶ added in v0.0.61
CoreContext contains information necessary to further process events inside Minder Core.
type MinderEvent ¶ added in v0.0.61
type MinderEvent struct { ProviderID uuid.UUID `json:"provider_id" validate:"required"` ProjectID uuid.UUID `json:"project_id" validate:"required"` EntityType minderv1.Entity `json:"entity_type" validate:"required"` EntityID uuid.UUID `json:"entity_id"` Properties map[string]any `json:"entity" validate:"required"` }
MinderEvent encapsulate necessary information about creation or deletion of entities so that they can be further processed by Minder core.
This struct is meant to be used with providers that can push events to Minder, or with providers that Minder can poll.
func NewMinderEvent ¶ added in v0.0.61
func NewMinderEvent() *MinderEvent
NewMinderEvent creates a new entity added event.
func (*MinderEvent) ToMessage ¶ added in v0.0.61
func (e *MinderEvent) ToMessage(msg *message.Message) error
ToMessage implements an interface that is currently used on the webhook handler. Such interface works by modifiying an existing message by means of side effect, which is unnecessary for this struct, thus its simplicity.
func (*MinderEvent) WithEntityID ¶ added in v0.0.61
func (e *MinderEvent) WithEntityID(entityID uuid.UUID) *MinderEvent
WithEntityID sets the id of the entity.
func (*MinderEvent) WithEntityType ¶ added in v0.0.61
func (e *MinderEvent) WithEntityType(entityType minderv1.Entity) *MinderEvent
WithEntityType sets the type of the entity. Type of the entity must be meaningful to the Provider.
func (*MinderEvent) WithProjectID ¶ added in v0.0.61
func (e *MinderEvent) WithProjectID(projectID uuid.UUID) *MinderEvent
WithProjectID adds project id to MinderEvent.
func (*MinderEvent) WithProperties ¶ added in v0.0.65
func (e *MinderEvent) WithProperties(props *properties.Properties) *MinderEvent
WithProperties adds properties to MinderEvent.
func (*MinderEvent) WithProviderID ¶ added in v0.0.61
func (e *MinderEvent) WithProviderID(providerID uuid.UUID) *MinderEvent
WithProviderID adds provider id to MinderEvent.
type RepoReconcilerEvent ¶
type RepoReconcilerEvent struct { // Project is the project that the event is relevant to Project uuid.UUID `json:"project"` // Provider is the provider that the event is relevant to Provider uuid.UUID `json:"provider"` // EntityID is the entity id of the repository to be reconciled EntityID uuid.UUID `json:"entity_id"` }
RepoReconcilerEvent is an event that is sent to the reconciler topic