package
Version:
v2.3.0
Opens a new window with list of versions in this module.
Published: Aug 28, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package singleton provides an atomic holder for a process-wide default instance of a service
type Value[T any] struct {
}
Value holds a process-wide default instance of T
func (v *Value[T]) Get() *T
Get returns the process-wide default instance, or nil when none is registered
func (v *Value[T]) Set(instance *T)
Set registers the process-wide default instance
Source Files
¶
Click to show internal directories.
Click to hide internal directories.