registry

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 0 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package registry defines a generic Registry interface used throughout TNET for plugin-style component registration and lookup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry[T any] interface {
	// Register adds a value under the given name. Returns an error if the
	// name is already registered.
	Register(name string, v T) error
	// Unregister removes the value registered under the given name.
	Unregister(name string)
	// IsRegistered reports whether a value is registered under the name.
	IsRegistered(name string) bool
	// Get returns the value registered under the name, or the zero value
	// of T if not registered.
	Get(name string) T
	// GetAll returns all registered name-to-value mappings.
	GetAll() map[string]T
}

Registry is a generic named container. Every component type in TNET (handlers, listeners, dialers, connectors, authenticators, etc.) has its own Registry instance. Components are registered by name (usually via init() side-effects and blank imports) and retrieved by name at config parsing time.

Jump to

Keyboard shortcuts

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