tinkering

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-29 17:36:45 -06:00
parent e575b71f07
commit 29cb5564c2
2 changed files with 65 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"io"
"go.wit.com/gui"
)
@ -12,8 +13,23 @@ type Size interface {
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 {
@ -22,9 +38,19 @@ type Draw interface {
}
type Droplet interface {
Box() *DropletBox
Draw
Menu
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 Normal file
View File

@ -0,0 +1,38 @@
/*
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
}