Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrComponentNotRegistered = eris.New("component not registered")
Functions ¶
func NewComponentMetadata ¶
NewComponentMetadata creates a new component type. The function is used to create a new component of the type.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(schemaStorage SchemaStorage) *Manager
NewManager creates a new component manager.
func (*Manager) GetComponentByName ¶
func (m *Manager) GetComponentByName(name string) (types.ComponentMetadata, error)
GetComponentByName returns the component metadata for the given component name.
func (*Manager) GetComponents ¶
func (m *Manager) GetComponents() []types.ComponentMetadata
GetComponents returns a list of all registered components. Note: The order of the components in the list is not deterministic.
func (*Manager) RegisterComponent ¶
func (m *Manager) RegisterComponent(compMetadata types.ComponentMetadata) error
RegisterComponent registers component with the component manager. There can only be one component with a given name, which is declared by the user by implementing the Name() method. If there is a duplicate component name, an error will be returned and the component will not be registered.
type Option ¶
Option is a type that can be passed to NewComponentMetadata to augment the creation of the component type.
func WithDefault ¶
WithDefault updated the created componentMetadata with a default value.