Help us shape the future of Go! Take the 2026 Go Developer Survey

events

package
v0.34.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package events is the bus: plugins, the engine and agents publish typed events such as deploy.finished, and hooks subscribe by topic pattern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(pattern, topic string) bool

Match says whether topic matches pattern; * stands for one dot-separated part, and a lone * for any topic.

Types

type Bus

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

func NewBus

func NewBus() *Bus

func (*Bus) Hooks

func (b *Bus) Hooks(on map[string][]string, run func(steps []string, e Event)) (stop func())

Hooks subscribes `on:` entries: each topic pattern's steps go to run with the event that fired them.

func (*Bus) Publish

func (b *Bus) Publish(e Event)

Publish delivers e to its subscribers in turn, on the caller's goroutine; a slow subscriber goes async itself.

func (*Bus) Subscribe

func (b *Bus) Subscribe(pattern string, fn func(Event)) (stop func())

Subscribe calls fn for every event whose topic matches pattern, until the returned stop.

type Event

type Event = protocol.Event

Jump to

Keyboard shortcuts

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