Skip to content

Instantly share code, notes, and snippets.

@pboothe
Created March 26, 2019 14:22
Show Gist options
  • Save pboothe/f283830cd0b4d07508b8866d383ee219 to your computer and use it in GitHub Desktop.
Save pboothe/f283830cd0b4d07508b8866d383ee219 to your computer and use it in GitHub Desktop.
NewConnector() (Connector) {
return &sshConnector{...}
}
type sshConnector struct {
dialer dialer
}
func (s *sshConnector) NewConnection(...) {
s.dialer.Dial()
}
type ConnectionConfig struct {
...
}
type Connector interface {
NewConnection() (Connection, error)
}
type Connection interface {
Reboot() (string, error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment