builder

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package builder provides a fluent API for constructing events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBuilder

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

EventBuilder provides a fluent interface for building events.

func AgentExecuted

func AgentExecuted(agentID, action string) *EventBuilder

AgentExecuted creates a builder for an agent executed event.

func EmailSent

func EmailSent(emailID, recipient string) *EventBuilder

EmailSent creates a builder for an email sent event.

func JobCompleted

func JobCompleted(jobID string, duration float64) *EventBuilder

JobCompleted creates a builder for a job completed event.

func JobEnqueued

func JobEnqueued(jobID, jobType string) *EventBuilder

JobEnqueued creates a builder for a job enqueued event.

func JobFailed

func JobFailed(jobID string, err error, attempts int) *EventBuilder

JobFailed creates a builder for a job failed event.

func JobStarted

func JobStarted(jobID, workerID string) *EventBuilder

JobStarted creates a builder for a job started event.

func NewEvent

func NewEvent(eventType bus.EventType) *EventBuilder

NewEvent creates a new EventBuilder with the given event type.

func TestSuiteCompleted

func TestSuiteCompleted(suiteID string, passed, failed, skipped int) *EventBuilder

TestSuiteCompleted creates a builder for a test suite completed event.

func WebhookTriggered

func WebhookTriggered(webhookID, url string) *EventBuilder

WebhookTriggered creates a builder for a webhook triggered event.

func WorkflowCompleted

func WorkflowCompleted(workflowID string, duration float64) *EventBuilder

WorkflowCompleted creates a builder for a workflow completed event.

func WorkflowFailed

func WorkflowFailed(workflowID string, err error) *EventBuilder

WorkflowFailed creates a builder for a workflow failed event.

func WorkflowStarted

func WorkflowStarted(workflowID string) *EventBuilder

WorkflowStarted creates a builder for a workflow started event.

func (*EventBuilder) Build

func (b *EventBuilder) Build() bus.Event

Build returns the constructed event.

func (*EventBuilder) WithData

func (b *EventBuilder) WithData(key string, value interface{}) *EventBuilder

WithData adds a key-value pair to the event data.

func (*EventBuilder) WithDataMap

func (b *EventBuilder) WithDataMap(data map[string]interface{}) *EventBuilder

WithDataMap merges the given map into the event data.

func (*EventBuilder) WithID

func (b *EventBuilder) WithID(id string) *EventBuilder

WithID sets a custom ID for the event.

func (*EventBuilder) WithMetadata

func (b *EventBuilder) WithMetadata(key, value string) *EventBuilder

WithMetadata adds a key-value pair to the event metadata.

func (*EventBuilder) WithMetadataMap

func (b *EventBuilder) WithMetadataMap(metadata map[string]string) *EventBuilder

WithMetadataMap merges the given map into the event metadata.

func (*EventBuilder) WithSource

func (b *EventBuilder) WithSource(source string) *EventBuilder

WithSource sets the source of the event.

func (*EventBuilder) WithTimestamp

func (b *EventBuilder) WithTimestamp(t time.Time) *EventBuilder

WithTimestamp sets a custom timestamp for the event.

Jump to

Keyboard shortcuts

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