node.go 611 B

1234567891011121314151617181920212223242526
  1. package modelse
  2. import (
  3. "sync"
  4. )
  5. type NodeInfoT struct {
  6. Hostname string `json:"hostname"`
  7. HostIp string `json:"host_ip"`
  8. KernelVersion string `json:"kernel_version"`
  9. SystemUUID string `json:"system_uuid"`
  10. HostID int64 `json:"host_id"`
  11. AccountID int `json:"account_id"`
  12. LicenseKey string `json:"license_key"`
  13. Lock sync.RWMutex `json:"lock,omitempty"`
  14. }
  15. type NodeInfoInterface interface {
  16. GetNodeInfo() *NodeInfoT
  17. }
  18. func (n *NodeInfoT) GetNodeInfo() *NodeInfoT {
  19. n.Lock.Lock()
  20. defer n.Lock.Unlock()
  21. return n
  22. }