package modelse import ( "sync" ) var ( NODE_INFO *NodeInfoT ) type NodeInfoT struct { Hostname string `json:"hostname"` HostIp string `json:"host_ip"` KernelVersion string `json:"kernel_version"` SystemUUID string `json:"system_uuid"` HostID int64 `json:"host_id"` AccountID int `json:"account_id"` LicenseKey string `json:"license_key"` Lock sync.RWMutex `json:"lock,omitempty"` AgentVersion string `json:"agent_version"` SysTag string `json:"sys"` } type NodeInfoInterface interface { GetNodeInfo() *NodeInfoT } func init() { NODE_INFO = new(NodeInfoT) } func (n *NodeInfoT) GetNodeInfo() *NodeInfoT { n.Lock.Lock() defer n.Lock.Unlock() return n }