Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtomicRegistry ¶
type AtomicRegistry struct {
atomic.Value
}
func NewAtomicRegistry ¶
func NewAtomicRegistry(initialValue *Registry) AtomicRegistry
NewAtomicRegistry creates a new envelope to hold a Registry object.
type PluginID ¶
type PluginID = string
const (
PluginIDWorkflowExecutor PluginID = "WorkflowExecutor"
PluginIDDataProxy PluginID = "DataProxy"
PluginIDUnaryServiceMiddleware PluginID = "UnaryServiceMiddleware"
)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a generic plugin registrar for dependency injection.
func (*Registry) Get ¶
func (r *Registry) Get(id PluginID) interface{}
Get retrieves a registered implementation for the ID. If one doesn't exist, it returns the default implementation. If the id isn't found, it returns nil.
func (*Registry) Register ¶
func (r *Registry) Register(id PluginID, impl interface{}) error
Register registers a new implementation for the pluginID. Only one plugin is allowed to be registered for a given ID.
func (*Registry) RegisterDefault ¶
func (r *Registry) RegisterDefault(id PluginID, impl interface{})
RegisterDefault registers a new implementation for the pluginID. This is the implementation that will be used if no other plugin is registered for the ID.
Click to show internal directories.
Click to hide internal directories.