internal/component: Further optimize initialization

This commit is contained in:
Tom Wiesing 2022-10-05 15:23:29 +02:00
parent abc985892a
commit 84dcaa62a9
No known key found for this signature in database
6 changed files with 280 additions and 294 deletions

View file

@ -3,15 +3,12 @@ package component
// Component represents a logical subsystem of the distillery.
// Every component must embed [ComponentBase] and should be initialized using [Initialize].
// A Component should be implemented as a pointer to a struct.
//
// By convention these are defined within their corresponding subpackage.
// This subpackage also contains all required resources.
// Furthermore, a component is typically instantiated using a call on the ["distillery.Distillery"] struct.
//
// For example, the web.Web component lives in the web package and can be created like:
//
// var dis Distillery
// web := dis.Web()
// Components are initialized using a [Pool].
type Component interface {
// Name returns the name of this component.
// It should correspond to the appropriate subpackage.