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

trackinghostlog

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package trackinghostlog writes the change log behind the service read of Tracking domain hosts (ADR 0038). A Sending domain is a verified host while its tracking_state is dns_verified or serving and it is not archived (Serving, the one definition the host gate shares); each change of that (a host entering a state, or leaving both because its record stopped resolving, or its Sending domain was archived, deleted or renamed; an unarchive is an addition once the host is verified again) is one row of tracking_host_changes, so a removal is never silence.

Two ent hooks keep it so no write path can forget it, the same pair as internal/workspacefeed. Hook runs on every transaction client (the event bus's): the change and its log row commit together, in the order the positions were taken. Guard runs on the plain client (db.NewEntClient) and refuses a change to a host outside a transaction, where the log row would be a separate statement that a crash loses. The hook reads Sending domains of any Workspace to find the hosts a change touches, which is why this package is on the closed list of raw-client packages in docs/architecture.md.

Index

Constants

This section is empty.

Variables

View Source
var ErrNeedsTransaction = errors.New("tracking host change outside a transaction")

ErrNeedsTransaction is what Guard returns for a change to a host made on a client that is not bound to a transaction.

Functions

func Guard

func Guard(next ent.Mutator) ent.Mutator

Guard is the ent hook for a client that is not bound to a transaction: it refuses every mutation that Hook would log. Such a change goes through the event bus's transaction (events.Bus.WithinTx).

func Hook

func Hook(next ent.Mutator) ent.Mutator

Hook is the ent hook to install on a client bound to a transaction (Client.Use). It is a no-op for every mutation that cannot change what the log reports.

func Serving

func Serving() predicate.SendingDomain

Serving selects the Sending domains that serve their Tracking host: a verified tracking state and not archived (ADR 0049). It is the query form of serves; the host gate and the recheck job use it, so there is one definition.

Types

This section is empty.

Jump to

Keyboard shortcuts

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