Documentation
¶
Index ¶
- Variables
- func GetNodeInfo(nodeID int, key string) (*model.NodeInfo, error)
- func GetNodeRule(nodeID int, key string) (*model.Rule, error)
- func GetUserList(nodeID int, key string) ([]*model.UserInfo, error)
- func PostAllUserTraffic(allUserTraffic []*model.UserTraffic, nodeID int, key string) error
- func PostNodeOnline(nodeOnline []*model.NodeOnline, nodeID int, key string) error
- func PostNodeStatus(status model.NodeStatus, nodeID int, key string) error
- func PostTrigger(nodeID int, key string, trigger model.Trigger) error
- func SetHost(host string)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
HOST = ""
)
Functions ¶
func GetNodeInfo ¶
GetNodeInfo
Example ¶
HOST = "http://localhost" logrus.SetLevel(logrus.DebugLevel) result, _ := GetNodeInfo(2, "txsnvhghmrmg4pjm") fmt.Printf("value: %+v \n", result)
Output:
func GetUserList ¶
GetUserList
Example ¶
HOST = "http://dash.kitami.ml" logrus.SetLevel(logrus.DebugLevel) result, _ := GetUserList(1, "vrrwwnprz6cmytzp") fmt.Printf("value: %+v\n", result)
Output:
func PostAllUserTraffic ¶
func PostAllUserTraffic(allUserTraffic []*model.UserTraffic, nodeID int, key string) error
Example ¶
HOST = "http://localhost" logrus.SetLevel(logrus.DebugLevel) PostAllUserTraffic([]*model.UserTraffic{ { 1, 200, 200, 0, 0, }, }, 1, "txsnvhghmrmg4pjm")
Output:
func PostNodeOnline ¶
func PostNodeOnline(nodeOnline []*model.NodeOnline, nodeID int, key string) error
Example ¶
HOST = "http://localhost" logrus.SetLevel(logrus.DebugLevel) PostNodeOnline([]*model.NodeOnline{ { 1, "192.168.1.1", }, }, 1, "txsnvhghmrmg4pjm")
Output:
func PostNodeStatus ¶
func PostNodeStatus(status model.NodeStatus, nodeID int, key string) error
Example ¶
HOST = "http://localhost" logrus.SetLevel(logrus.DebugLevel) PostNodeStatus(model.NodeStatus{ CPU: "10%", MEM: "10%", DISK: "10", NET: "up: 50kb,down: 50kb", UPTIME: 2000, }, 1, "txsnvhghmrmg4pjm")
Output:
func PostTrigger ¶
when user trigger audit rules then report
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.