Refactor components
This commit is contained in:
parent
17011a277f
commit
487ce09979
7 changed files with 117 additions and 63 deletions
|
|
@ -34,6 +34,10 @@ type Component interface {
|
|||
// Context returns a new InstallationContext to be used during installation from the command line.
|
||||
// Typically this should just pass through the parent, but might perform other tasks.
|
||||
Context(parent InstallationContext) InstallationContext
|
||||
|
||||
// Base() returns a reference to a base component
|
||||
// This is implemented by an embedding on ComponentBase
|
||||
Base() *ComponentBase
|
||||
}
|
||||
|
||||
// ComponentBase implements base functionality for a component
|
||||
|
|
@ -43,6 +47,11 @@ type ComponentBase struct {
|
|||
Config *config.Config // Config is the configuration of the underlying distillery
|
||||
}
|
||||
|
||||
// Base returns a reference to the ComponentBase
|
||||
func (cb *ComponentBase) Base() *ComponentBase {
|
||||
return cb
|
||||
}
|
||||
|
||||
// Path returns the path to this component
|
||||
func (cb ComponentBase) Path() string {
|
||||
return cb.Dir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue