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 ¶
CoreContext contains information necessary to further process events inside Minder Core.
type MinderEvent ¶
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 ¶
func NewMinderEvent() *MinderEvent
NewMinderEvent creates a new entity added event.
func (*MinderEvent) ToMessage ¶
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 ¶
func (e *MinderEvent) WithEntityID(entityID uuid.UUID) *MinderEvent
WithEntityID sets the id of the entity.
func (*MinderEvent) WithEntityType ¶
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 ¶
func (e *MinderEvent) WithProjectID(projectID uuid.UUID) *MinderEvent
WithProjectID adds project id to MinderEvent.
func (*MinderEvent) WithProperties ¶
func (e *MinderEvent) WithProperties(props *properties.Properties) *MinderEvent
WithProperties adds properties to MinderEvent.
func (*MinderEvent) WithProviderID ¶
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