events

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GenericTopic is the Kafka topic where all events are produced
	GenericTopic = "assisted.migration.events"

	// DefaultEventSource is the CloudEvent source field
	DefaultEventSource = "migration-planner"

	AssessmentCreatedEventType = "assisted.migration.assessment.created"
	AssessmentDeletedEventType = "assisted.migration.assessment.deleted"
	// PartnerCustomerEventType covers partner-customer relationship changes (request, accept, cancel, etc.)
	PartnerCustomerEventType = "assisted.migration.partner_customer.updated"

	// User action event types track discrete user actions (share, unshare, sizing, OVA download, etc.)
	ShareAssessmentEventType         = "assisted.migration.user_action.assessment_shared"
	UnshareAssessmentEventType       = "assisted.migration.user_action.assessment_unshared"
	SizingEventType                  = "assisted.migration.user_action.sizing_requested"
	MigrationComplexityEventType     = "assisted.migration.user_action.complexity_estimated"
	MigrationTimeEstimationEventType = "assisted.migration.user_action.time_estimated"
	DownloadOVAEventType             = "assisted.migration.user_action.ova_downloaded"
	VisitorEventType                 = "assisted.migration.user_action.visited"
)

Variables

This section is empty.

Functions

func BuildCloudEvent

func BuildCloudEvent(eventType string, payload any) ([]byte, error)

Types

type AssessmentData

type AssessmentData struct {
	ID         string          `json:"id"`
	SnapshotID uint            `json:"snapshot_id,omitempty"`
	Name       string          `json:"name,omitempty"`
	OrgID      string          `json:"org_id,omitempty"`
	Username   string          `json:"username,omitempty"`
	SourceType string          `json:"source_type,omitempty"`
	PartnerID  *string         `json:"partner_id,omitempty"`
	Location   *string         `json:"location,omitempty"`
	Inventory  json.RawMessage `json:"inventory,omitempty"`
	CreatedAt  time.Time       `json:"created_at,omitempty"`
	UpdatedAt  *time.Time      `json:"updated_at,omitempty"`
	DeletedAt  *time.Time      `json:"deleted_at,omitempty"`
}

type AssessmentEventPayload

type AssessmentEventPayload struct {
	Assessment AssessmentData `json:"assessment"`
}

func NewAssessmentCreatedPayload

func NewAssessmentCreatedPayload(data AssessmentData) AssessmentEventPayload

func NewAssessmentDeletedPayload

func NewAssessmentDeletedPayload(assessmentID string) AssessmentEventPayload

type ComplexityActionData

type ComplexityActionData struct {
	AssessmentID string `json:"assessment_id"`
}

type KafkaProducer

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

func NewKafkaProducer

func NewKafkaProducer(brokers []string, opts ...kgo.Opt) (*KafkaProducer, error)

func (*KafkaProducer) Close

func (p *KafkaProducer) Close()

func (*KafkaProducer) Ping

func (p *KafkaProducer) Ping(ctx context.Context) error

func (*KafkaProducer) Write

func (p *KafkaProducer) Write(ctx context.Context, topic string, data []byte) error

type NoOpWriter

type NoOpWriter struct{}

func NewNoOpWriter

func NewNoOpWriter() *NoOpWriter

func (*NoOpWriter) Write

func (w *NoOpWriter) Write(ctx context.Context, topic string, data []byte) error

type OVADownloadActionData

type OVADownloadActionData struct {
	SourceID string `json:"source_id"`
}

type PartnerCustomerData

type PartnerCustomerData struct {
	ID               string     `json:"id"`
	CustomerUsername string     `json:"customer_username"`
	PartnerID        string     `json:"partner_id"`
	RequestStatus    string     `json:"request_status"`
	Location         string     `json:"location"`
	AcceptedAt       *time.Time `json:"accepted_at,omitempty"`
	TerminatedAt     *time.Time `json:"terminated_at,omitempty"`
	CreatedAt        time.Time  `json:"created_at"`
}

type PartnerCustomerEventPayload

type PartnerCustomerEventPayload struct {
	PartnerCustomer PartnerCustomerData `json:"partner_customer"`
}

type ShareAssessmentActionData

type ShareAssessmentActionData struct {
	AssessmentID string `json:"assessment_id"`
	PartnerID    string `json:"partner_id"`
}

type SizingActionData

type SizingActionData struct {
	AssessmentID string `json:"assessment_id"`
}

type TimeEstimationActionData added in v0.16.0

type TimeEstimationActionData struct {
	AssessmentID string `json:"assessment_id"`
}

type UnshareAssessmentActionData

type UnshareAssessmentActionData struct {
	AssessmentID string `json:"assessment_id"`
}

type UserActionData

type UserActionData struct {
	Username  string    `json:"username"`
	Timestamp time.Time `json:"timestamp"`
	Data      any       `json:"data"`
}

type UserActionEventPayload

type UserActionEventPayload struct {
	UserAction UserActionData `json:"user_action"`
}

func NewComplexityPayload

func NewComplexityPayload(username, assessmentID string) UserActionEventPayload

func NewOVADownloadPayload

func NewOVADownloadPayload(username, sourceID string) UserActionEventPayload

func NewShareAssessmentPayload

func NewShareAssessmentPayload(username, assessmentID, partnerID string) UserActionEventPayload

func NewSizingPayload

func NewSizingPayload(username, assessmentID string) UserActionEventPayload

func NewTimeEstimationPayload added in v0.16.0

func NewTimeEstimationPayload(username, assessmentID string) UserActionEventPayload

func NewUnshareAssessmentPayload

func NewUnshareAssessmentPayload(username, assessmentID string) UserActionEventPayload

func NewVisitorPayload

func NewVisitorPayload(username, orgID string) UserActionEventPayload

type VisitorActionData added in v0.16.0

type VisitorActionData struct {
	OrgID string `json:"org_id"`
}

type Writer

type Writer interface {
	Write(ctx context.Context, topic string, data []byte) error
}

Jump to

Keyboard shortcuts

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