component

package module
v0.0.0-...-1673907 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	// Add new service
	AddService(def di.Def)

	// Add new component factory
	AddComponent(factory Factory)

	// Build a component and service registry
	Build() (Registry, error)
}

Builder is a component and service registry builder

func NewBuilder

func NewBuilder() Builder

NewBuilder creates a new instance of Builder

type Factory

type Factory func(c di.Container) (T, error)

Factory creates an instance of component from a DI container

type Registry

type Registry interface {
	// Get registered services
	Services() di.Container

	// Get registered components
	Components() []T
}

Registry is a component and service registry

type T

type T interface {
	// Start a component
	Start(group *sync.WaitGroup, stop chan interface{})
}

T is a runnable component that supports graceful shutdown

Jump to

Keyboard shortcuts

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