Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultStreamName is the JetStream stream for test events DefaultStreamName = "tests_events" // DefaultSubjectPrefix is the subject prefix for test events DefaultSubjectPrefix = "tests.events.v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Type EventType `json:"type"`
Timestamp time.Time `json:"timestamp"`
Data json.RawMessage `json:"data"`
}
Event represents a generic event wrapper for publishing
type EventType ¶
type EventType string
EventType represents the type of event being published
const ( EventTypeTestBegin EventType = "test.begin" EventTypeTestEnd EventType = "test.end" EventTypeStepBegin EventType = "step.begin" EventTypeStepEnd EventType = "step.end" EventTypeSuiteBegin EventType = "suite.begin" EventTypeSuiteEnd EventType = "suite.end" EventTypeTestFailure EventType = "test.failure" EventTypeTestError EventType = "test.error" EventTypeStdOutput EventType = "stdout" EventTypeStdError EventType = "stderr" EventTypeHeartbeat EventType = "heartbeat" EventTypeRunEnd EventType = "run.end" EventTypeRunStart EventType = "run.start" )
type NATSConfig ¶
NATSConfig holds configuration for NATS publisher
type NATSPublisher ¶
type NATSPublisher struct {
// contains filtered or unexported fields
}
NATSPublisher wraps a NATS JetStream connection for publishing events
func NewNATSPublisher ¶
func NewNATSPublisher(cfg NATSConfig, logger *slog.Logger) (*NATSPublisher, error)
NewNATSPublisher creates a new NATS JetStream publisher If logger is nil, a no-op logger is used
func (*NATSPublisher) Close ¶
func (p *NATSPublisher) Close() error
Close closes the NATS connection
Click to show internal directories.
Click to hide internal directories.