Documentation
¶
Overview ¶
Package seam holds the registration mechanism the open-core seams share.
Per D6 the private companion repository replaces a seam's implementation by blank-importing a package whose init() registers its own. Go initialises an imported package before its importer, so the OSS default — registered in the seam package's own init() — is always in place before a companion's init() runs, and the companion always wins. No build tags, no stubbed files in the public tree, no ordering hacks. It is the mechanism swarmcli-be already uses.
Two shapes cover every seam. Slot holds one implementation and registering replaces it: there is exactly one answer to "which swarm registry is in force". List holds every implementation and returns all of them: a companion adding a Slack notifier must not remove the log notifier or the API's event stream.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
List holds every registered implementation of T, in registration order. The zero List is ready to use.
func (*List[T]) All ¶
func (l *List[T]) All() []T
All returns every registered implementation. The result is a copy, so a caller ranging over it cannot race a late registration.
type Slot ¶
type Slot[T any] struct { // contains filtered or unexported fields }
Slot holds exactly one implementation of T. The zero Slot is ready to use and returns the zero T until something registers.