types.go 499 B

1234567891011121314151617181920212223242526272829303132333435
  1. package server
  2. import (
  3. "time"
  4. "github.com/gorilla/websocket"
  5. )
  6. type Agent struct {
  7. Name string
  8. Reg time.Time
  9. Cores int
  10. Cpu []int
  11. Mem_max float64
  12. Mem_usg []float64
  13. TaskId int
  14. conn *websocket.Conn
  15. }
  16. type Task struct {
  17. Puzzle [9]string
  18. Solutions [][]string
  19. }
  20. type Server struct {
  21. ListenAddress string
  22. ListenPort int
  23. Agents map[string]*Agent
  24. Tasks []Task
  25. }
  26. var upgrader = websocket.Upgrader{
  27. ReadBufferSize: 1024,
  28. WriteBufferSize: 1024,
  29. }