droplet/droplet.go

57 lines
649 B
Go
Raw Permalink Normal View History

2024-02-29 13:45:36 -06:00
package main
import (
"fmt"
"io"
2024-02-29 13:45:36 -06:00
"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
}
2024-02-29 13:45:36 -06:00
type Menu interface {
Widget() *gui.Node
SetMenu(*gui.Node)
2024-02-29 13:45:36 -06:00
}
type Draw interface {
Show() bool
Hide()
}
type Droplet interface {
Box() *DropletBox
2024-02-29 13:45:36 -06:00
Draw
SetMenu(*DropletBox)
2024-02-29 13:45:36 -06:00
Size
PowerOn() error
PowerOff() (bool, error)
Connect()
2024-02-29 13:45:36 -06:00
// Location
fmt.Stringer
io.Writer
}
func addMenu(d Droplet) {
d.Show()
// d.Menu.Widget() = gui.RawBox()
2024-02-29 13:45:36 -06:00
}