MCPcopy Create free account
hub / github.com/codnect/procyon / SingletonRegistry

Interface SingletonRegistry

component/singleton.go:18–32  ·  view source on GitHub ↗

SingletonRegistry defines methods for managing singleton instances within the component system.

Source from the content-addressed store, hash-verified

16
17// SingletonRegistry defines methods for managing singleton instances within the component system.
18type SingletonRegistry interface {
19 // RegisterSingleton registers a singleton instance with the given name.
20 // Returns an error if a singleton with the same name already exists.
21 RegisterSingleton(name string, instance any) error
22
23 // ContainsSingleton checks whether a singleton with the specified name exists.
24 ContainsSingleton(name string) bool
25
26 // Singleton retrieves the singleton instance associated with the given name.
27 // Returns the instance and a boolean indicating its existence.
28 Singleton(name string) (any, bool)
29
30 // RemoveSingleton removes the singleton instance associated with the specified name.
31 RemoveSingleton(name string) error
32}

Callers

nothing calls this directly

Implementers 2

AnyContainercomponent/container_test.go
DefaultContainercomponent/container.go

Calls

no outgoing calls

Tested by

no test coverage detected