events

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CreatedEvent events.EventType = "created"
View Source
const ExecutedEvent events.EventType = "executed"
View Source
const UpdatedEvent events.EventType = "updated"

Variables

WireSet provides a wire set for this package.

Functions

func NewReaderFactory

func NewReaderFactory(eventsSystem *events.System) (*events.ReaderFactory[*Reader], error)

func ProvideReaderFactory

func ProvideReaderFactory(eventsSystem *events.System) (*events.ReaderFactory[*Reader], error)

Types

type CreatedPayload

type CreatedPayload struct {
	PipelineID int64 `json:"pipeline_id"`
	RepoID     int64 `json:"repo_id"`
}

type ExecutedPayload

type ExecutedPayload struct {
	PipelineID   int64         `json:"pipeline_id"`
	RepoID       int64         `json:"repo_id"`
	ExecutionNum int64         `json:"execution_number"`
	Status       enum.CIStatus `json:"status"`
}

type Reader

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

Reader is the event reader for this package. It exposes typesafe event registration methods for all events by this package. NOTE: Event registration methods are in the event's dedicated file.

func (*Reader) Configure

func (r *Reader) Configure(opts ...events.ReaderOption)

func (*Reader) RegisterCreated

func (r *Reader) RegisterCreated(fn events.HandlerFunc[*CreatedPayload],
	opts ...events.HandlerOption) error

func (*Reader) RegisterExecuted

func (r *Reader) RegisterExecuted(fn events.HandlerFunc[*ExecutedPayload],
	opts ...events.HandlerOption) error

func (*Reader) RegisterUpdated

func (r *Reader) RegisterUpdated(fn events.HandlerFunc[*UpdatedPayload],
	opts ...events.HandlerOption) error

type Reporter

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

Reporter is the event reporter for this package. It exposes typesafe send methods for all events of this package. NOTE: Event send methods are in the event's dedicated file.

func NewReporter

func NewReporter(eventsSystem *events.System) (*Reporter, error)

func ProvideReporter

func ProvideReporter(eventsSystem *events.System) (*Reporter, error)

func (*Reporter) Created

func (r *Reporter) Created(ctx context.Context, payload *CreatedPayload)

func (*Reporter) Executed

func (r *Reporter) Executed(ctx context.Context, payload *ExecutedPayload)

func (*Reporter) Updated

func (r *Reporter) Updated(ctx context.Context, payload *UpdatedPayload)

type UpdatedPayload

type UpdatedPayload struct {
	PipelineID int64 `json:"pipeline_id"`
	RepoID     int64 `json:"repo_id"`
}

Jump to

Keyboard shortcuts

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