audit

package
v0.6.31 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package audit reacts to the service's own Greeted event: a reactor is a durable consumer, so it sees every greeting of every instance, once each (it is idempotent under redelivery).

Index

Constants

View Source
const Consumer = "hello-greeted-audit"

Consumer is the reactor's pinned consumer name: moving or renaming the component keeps the consumer and its position on the stream.

Variables

View Source
var ErrNoName = errors.New("audit: greeted without a name")

ErrNoName: a Greeted without a name; no retry fixes it.

Functions

This section is empty.

Types

type Audit

type Audit struct {
	deps.Component
	// contains filtered or unexported fields
}

Audit counts greetings per name as they come off the stream.

func New

func New(parent deps.Scope, greeted event.Ref[greeter.Greeted]) *Audit

New creates the audit under parent and subscribes it to greeted.

func (*Audit) Count

func (a *Audit) Count(name string) uint64

Count is how many greetings of name were audited.

func (*Audit) Total

func (a *Audit) Total() uint64

Total is how many greetings were audited.

Jump to

Keyboard shortcuts

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