Compare commits
No commits in common. "master" and "v0.0.1" have entirely different histories.
14
Makefile
14
Makefile
|
@ -1,16 +1,10 @@
|
|||
GUIVERSION = $(shell cd ~/go/src/go.wit.com/gui; git describe --tags)
|
||||
|
||||
all: build
|
||||
|
||||
vet:
|
||||
all:
|
||||
@#GO111MODULE=off go build
|
||||
@GO111MODULE=off go vet -x
|
||||
@echo this go library package builds okay
|
||||
|
||||
build:
|
||||
@GO111MODULE=off go build -v -x -o junk \
|
||||
-ldflags "-X main.GUIVERSION=${GUIVERSION}" \
|
||||
-ldflags "-X go.wit.com/gui.GUIVERSION=${GUIVERSION}"
|
||||
@GO111MODULE=off go build -x -o junk
|
||||
./junk
|
||||
|
||||
goimports:
|
||||
|
@ -22,7 +16,3 @@ redomod:
|
|||
GO111MODULE= go mod init
|
||||
GO111MODULE= go mod tidy
|
||||
|
||||
|
||||
actual: redomod
|
||||
GO111MODULE= go build -x -o junk
|
||||
./junk
|
||||
|
|
1
area.go
1
area.go
|
@ -48,6 +48,7 @@ func main() {
|
|||
|
||||
l := Less(c, s)
|
||||
fmt.Printf("%v is the smallest\n", l)
|
||||
|
||||
}
|
||||
|
||||
func Less(s1, s2 Sizer) Sizer {
|
||||
|
|
56
droplet.go
56
droplet.go
|
@ -1,56 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"go.wit.com/gui"
|
||||
)
|
||||
|
||||
type Size interface {
|
||||
Cpus() int
|
||||
Memory() float64
|
||||
Disk() float64
|
||||
}
|
||||
|
||||
type SquareBox struct {
|
||||
Width float64
|
||||
Height float64
|
||||
}
|
||||
|
||||
type MenuNode struct {
|
||||
Name string
|
||||
Box *gui.Node
|
||||
}
|
||||
|
||||
func (s MenuNode) Area() float64 {
|
||||
return 20
|
||||
}
|
||||
|
||||
type Menu interface {
|
||||
Widget() *gui.Node
|
||||
SetMenu(*gui.Node)
|
||||
}
|
||||
|
||||
type Draw interface {
|
||||
Show() bool
|
||||
Hide()
|
||||
}
|
||||
|
||||
type Droplet interface {
|
||||
Box() *DropletBox
|
||||
Draw
|
||||
SetMenu(*DropletBox)
|
||||
Size
|
||||
PowerOn() error
|
||||
PowerOff() (bool, error)
|
||||
Connect()
|
||||
// Location
|
||||
fmt.Stringer
|
||||
io.Writer
|
||||
}
|
||||
|
||||
func addMenu(d Droplet) {
|
||||
d.Show()
|
||||
// d.Menu.Widget() = gui.RawBox()
|
||||
}
|
38
structs.go
38
structs.go
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
The DropletBox Struct
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/digitalocean/godo"
|
||||
|
||||
"go.wit.com/gui"
|
||||
)
|
||||
|
||||
type DropletBox struct {
|
||||
ID int
|
||||
image string
|
||||
memory int
|
||||
disk int
|
||||
|
||||
ready bool
|
||||
hidden bool
|
||||
err error
|
||||
|
||||
poll *godo.Droplet // store what the digital ocean API returned
|
||||
|
||||
nameN *gui.Node
|
||||
sizeSlugN *gui.Node
|
||||
statusN *gui.Node
|
||||
imageN *gui.Node
|
||||
|
||||
destroy *gui.Node
|
||||
connect *gui.Node
|
||||
poweron *gui.Node
|
||||
poweroff *gui.Node
|
||||
edit *gui.Node
|
||||
|
||||
ipv4 *gui.Node
|
||||
ipv6 *gui.Node
|
||||
}
|
Loading…
Reference in New Issue