hostbus

package
v0.0.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublishAndWait added in v0.0.14

func PublishAndWait(ctx context.Context, bus HostRegistrationBus, bundle URLBundle) error

PublishAndWait delivers a bundle through an acknowledgement-aware bus and waits until its subscriber has completed processing. Ordinary HostRegistrationBus implementations remain valid; callers that need the stricter startup barrier receive a generic error when the capability is not available.

func SupportsAcknowledgement added in v0.0.14

func SupportsAcknowledgement(bus HostRegistrationBus) bool

SupportsAcknowledgement reports whether bus can provide the stricter startup publication barrier. Callers that receive false must retain the ordinary Publish path rather than making this additive capability mandatory.

Types

type HostRegistrationBus

type HostRegistrationBus interface {
	Publish(ctx context.Context, bundle URLBundle) error
	Close() error
}

HostRegistrationBus is the public interface for publishing URL bundles. Implementations are package-private to prevent external construction.

func New

func New(subscriber chan URLBundle) (HostRegistrationBus, error)

New constructs a new host registration bus with the provided subscriber channel.

type StartupCatalogState added in v0.0.14

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

StartupCatalogState is a one-shot barrier for startup catalog completion. It is intentionally separate from readiness state: callers may wait for a stricter startup milestone without changing existing health semantics.

func NewStartupCatalogState added in v0.0.14

func NewStartupCatalogState() *StartupCatalogState

NewStartupCatalogState constructs an unset startup catalog barrier.

func (*StartupCatalogState) Complete added in v0.0.14

func (s *StartupCatalogState) Complete(err error)

Complete settles the startup catalog barrier. The first result wins.

func (*StartupCatalogState) Wait added in v0.0.14

Wait blocks until startup catalog completion or context cancellation.

type Tag

type Tag struct {
	Key   TagKey
	Value string
}

Tag associates a tag key with a value.

type TagKey

type TagKey int

TagKey identifies a URL tag category.

const (
	TagKeyUnspecified TagKey = iota
	TagKeySource
	TagKeyRole
	TagKeyIndex
	TagKeyGroup
)

type URLBundle

type URLBundle struct {
	FetchedAt time.Time
	URLs      []URLRecord
	// contains filtered or unexported fields
}

URLBundle captures a set of URLs discovered by any component. It keeps transport hints generic and intentionally avoids OAuth-specific fields.

func (URLBundle) Acknowledge added in v0.0.14

func (b URLBundle) Acknowledge(err error)

Acknowledge reports that a subscriber has finished processing a bundle. It is a no-op for bundles delivered through Publish and only the first acknowledgement is observed for bundles delivered through PublishAndWait.

func (URLBundle) AcknowledgeAfter added in v0.0.14

func (b URLBundle) AcknowledgeAfter(err error, beforeAck func() error)

AcknowledgeAfter runs beforeAck immediately before acknowledging a PublishAndWait bundle. The callback is skipped for ordinary Publish bundles, which lets subscribers attach startup-only finalization work without changing fire-and-forget publication behavior.

func (URLBundle) RequiresAcknowledgement added in v0.0.14

func (b URLBundle) RequiresAcknowledgement() bool

RequiresAcknowledgement reports whether this bundle came from the stricter startup publication path. It exposes no bundle contents and lets the single subscriber keep ordinary later publications outside the startup boundary.

type URLRecord

type URLRecord struct {
	URL            *url.URL
	Description    string
	Tags           []Tag
	UnixSocketPath string

	// DisallowPrivateHostRegistration prevents this record from being admitted
	// as a private-host target or seeding OAuth protected-resource host policy.
	// An exact trusted protected-resource origin may still admit the record.
	DisallowPrivateHostRegistration bool
}

URLRecord describes a single URL plus optional metadata tags.

Jump to

Keyboard shortcuts

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