wisski-cloud-distillery/env/stack_ssh.go
Tom Wiesing 09431c4869
env: Move each component into a separate struct
This commit cleans up the distillery code by making each component a
distinct struct. Each of these components is also returned by by a new
Component() function that replaces the Stacks() function.
2022-09-08 14:39:04 +02:00

25 lines
565 B
Go

package env
import "github.com/FAU-CDI/wisski-distillery/internal/stack"
// SSHComponent represents the 'ssh' layer belonging to a distillery
type SSHComponent struct {
dis *Distillery
}
// SSH returns the SSHComponent belonging to this distillery
func (dis *Distillery) SSH() SSHComponent {
return SSHComponent{dis: dis}
}
func (SSHComponent) Name() string {
return "ssh"
}
func (ssh SSHComponent) Stack() stack.Installable {
return ssh.dis.makeComponentStack(ssh, stack.Installable{})
}
func (ssh SSHComponent) Path() string {
return ssh.Stack().Dir
}