File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ package driver
2+
3+ import (
4+ "github.com/docker/machine/libmachine/drivers"
5+ "github.com/docker/machine/libmachine/ssh"
6+ "github.com/docker/machine/libmachine/mcnflag"
7+ )
8+
9+ type Driver struct {
10+ * drivers.BaseDriver
11+
12+ SSHKeyPair * ssh.KeyPair
13+ }
14+
15+ func NewDriver () * Driver {
16+ return & Driver {
17+ BaseDriver : & drivers.BaseDriver {
18+ SSHUser : drivers .DefaultSSHUser ,
19+ SSHPort : drivers .DefaultSSHPort ,
20+ },
21+ }
22+ }
23+
24+ func (d * Driver ) DriverName () string {
25+ return "hetzner"
26+ }
27+
28+ const (
29+ defaultImage = "debian-9"
30+ defaultType = "g2-local"
31+ defaultLocation = "fsn1"
32+ )
33+
34+ func (d * Driver ) GetCreateFlags () []mcnflag.Flag {
35+ return []mcnflag.Flag {
36+ mcnflag.StringFlag {
37+ EnvVar : "HETZNER_API_TOKEN" ,
38+ Name : "hetzner-api-token" ,
39+ Usage : "Your project-specific Hetzner API token" ,
40+ Value : "" ,
41+ },
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ package driver
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "github.com/docker/machine/libmachine/drivers/plugin"
5+ "github.com/jonasprogrammer/docker-machine-hetzner-plugin/driver"
6+ )
7+
8+ func main () {
9+ plugin .RegisterDriver (driver .NewDriver ())
10+ }
You can’t perform that action at this time.
0 commit comments