component

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrComponentManager   = xerrors.New("error inside component manager", "E0410")
	ErrCyclicDependencies = ErrComponentManager.WithMessage("cycle detected in dependencies between components", "E0411")
)

Functions

func ExtractComponents

func ExtractComponents(app componego.Application) ([]componego.Component, error)

func NewManager

func NewManager() (componego.ComponentProvider, func(components []componego.Component) error)

Types

type Factory

type Factory interface {
	SetComponentIdentifier(identifier string)
	SetComponentVersion(version string)
	SetComponentComponents(components func() ([]componego.Component, error))
	SetComponentDependencies(dependencies func() ([]componego.Dependency, error))
	SetComponentInit(init func(env componego.Environment) error)
	SetComponentStop(stop func(env componego.Environment, prevErr error) error)
	Build() componego.Component
}

func NewFactory

func NewFactory(identifier string, version string) Factory

type QuickComponent

type QuickComponent struct {
	Identifier   string
	Version      string
	Components   func() ([]componego.Component, error)
	Dependencies func() ([]componego.Dependency, error)
	Init         func(env componego.Environment) error
	Stop         func(env componego.Environment, prevErr error) error
}

func (*QuickComponent) ComponentComponents

func (q *QuickComponent) ComponentComponents() ([]componego.Component, error)

ComponentComponents belongs to interface componego.ComponentComponents.

func (*QuickComponent) ComponentDependencies

func (q *QuickComponent) ComponentDependencies() ([]componego.Dependency, error)

ComponentDependencies belongs to interface componego.ComponentDependencies.

func (*QuickComponent) ComponentIdentifier

func (q *QuickComponent) ComponentIdentifier() string

ComponentIdentifier belongs to interface componego.Component.

func (*QuickComponent) ComponentInit

func (q *QuickComponent) ComponentInit(env componego.Environment) error

ComponentInit belongs to interface componego.ComponentInit.

func (*QuickComponent) ComponentStop

func (q *QuickComponent) ComponentStop(env componego.Environment, prevErr error) error

ComponentStop belongs to interface componego.ComponentStop.

func (*QuickComponent) ComponentVersion

func (q *QuickComponent) ComponentVersion() string

ComponentVersion belongs to interface componego.Component.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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