node

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunRpcServer

func RunRpcServer(port string, register interface{})

Types

type Args

type Args struct {
	Name string
	IP   string
}

type Attr

type Attr struct {
	Name  string `bson:"name" json:"name"`
	IP    string `bson:"ip" json:"ip"`
	Start int64  `bson:"start" json:"start"` // 启动时间
	HwMd5 string `bson:"md5" json:"md5"`
	Now   int64  `bson:"now" json:"now"`
}

type Bios

type Bios struct {
	Vendor string `json:"vendor"`
}

type Board

type Board struct {
	Name     string `json:"name"`
	Vendor   string `json:"vendor"`
	Version  string `json:"version"`
	Serial   string `json:"serial"`
	Assettag string `json:"assettag"`
}

type Chassis

type Chassis struct {
	Type     uint   `json:"type"`
	Vendor   string `json:"vendor"`
	Version  string `json:"version"`
	Serial   string `json:"vSerial"`
	Assettag string `json:"assettag"`
}

type Cpu

type Cpu struct {
	Vendor  string `json:"vendor"`
	Model   string `json:"model"`
	Speed   uint   `json:"speed"`
	Cache   uint   `json:"cache"`
	Cpus    uint   `json:"cpus"`
	Cores   uint   `json:"cores"`
	Threads uint   `json:"threads"`
}

type Hardware

type Hardware struct {
	Host    *Host    `bson:"host" json:"host"`
	Product *Product `json:"product"`
	Board   *Board   `json:"board"`
	//Chassis  *Chassis   `json:"chassis"`
	Bios     *Bios      `json:"bios"`
	Cpu      *Cpu       `bson:"cpu" json:"cpu"`
	Mem      *Mem       `json:"mem"`
	Networks []*Network `json:"networks"`
}

type Host

type Host struct {
	Machineid    string `json:"machineid"` // 设备id
	Hypervisor   string `json:"hypervisor"`
	Architecture string `json:"architecture"` // 架构
}

type Mem

type Mem struct {
	Type  string `json:"type"`  // type
	Speed uint   `json:"speed"` // 速率
}

内存

type Network

type Network struct {
	Driver     string `json:"driver"`
	Macaddress string `json:"macaddress"`
	Speed      uint   `json:"speed"`
}

type Node

type Node struct {
	*Attr
	*Hardware
}

func GetRemoteNode

func GetRemoteNode(ctx context.Context, name, ip, port string) (node *Node, err error)

func NewNode

func NewNode(name, ip string) (n *Node)

func (*Node) Status

func (n *Node) Status(args Args, node *Node) (err error)

type Product

type Product struct {
	Name    string `json:"name"`
	Vendor  string `json:"vendor"`
	Version string `json:"version"`
	Serial  string `json:"serial"`
}

type Storage

type Storage struct {
	Driver string `json:"driver"`
	Vendor string `json:"vendor"`
	Model  string `json:"model"`
	Serial string `json:"serial"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL