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

event

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogMessage

func LogMessage(msg string, client pb.TaskQueueClient, taskID int32)

send simple log message

func ReportInstallError

func ReportInstallError(c pb.TaskQueueClient, workerName, msg string, err error, ctx context.Context)

func SendRuntimeEventWithRetry

func SendRuntimeEventWithRetry(serverAddr, token string, workerID int32, workerName, level, class, msg string, details map[string]any)

in cmd/client (or client/event), mirroring sendInstallErrorWithRetry prefer using the Reporter struct instead: this function is used in case ther Reporter is not available

Types

type Reporter

type Reporter struct {
	Client     pb.TaskQueueClient
	WorkerID   int32
	WorkerName string
	Timeout    time.Duration // per-call timeout, e.g. 5s
	// contains filtered or unexported fields
}

Reporter now manages per-task workers instead of a global outbox.

func NewReporter

func NewReporter(client pb.TaskQueueClient, workerID int32, workerName string, timeout time.Duration) *Reporter

NewReporter constructs a Reporter; workers are created lazily per task on first update.

func (*Reporter) Event

func (r *Reporter) Event(level, class, msg string, details map[string]any)

func (*Reporter) QueueLog

func (r *Reporter) QueueLog(taskID int32, msg string)

QueueLog enqueues a log message to be sent for the given task.

func (*Reporter) StopOutbox

func (r *Reporter) StopOutbox()

StopOutbox stops all per-task workers. This is best-effort and returns after workers have exited their current send (bounded by per-RPC timeout).

func (*Reporter) UpdateTask

func (r *Reporter) UpdateTask(taskID int32, status string, logMessage string) error

func (*Reporter) UpdateTaskAsync

func (r *Reporter) UpdateTaskAsync(taskID int32, status, msg string, duration *int32)

UpdateTaskAsync enqueues the latest desired status for a task. Newer updates overwrite any queued older one (latest-wins coalescing). Sending is serialized per task by its worker.

Jump to

Keyboard shortcuts

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