client

package
v0.0.0-...-8deeed5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	HOST = ""
)

Functions

func GetNodeInfo

func GetNodeInfo(nodeID int, key string) (*model.NodeInfo, error)

GetNodeInfo

Example
HOST = "http://localhost"
logrus.SetLevel(logrus.DebugLevel)
result, _ := GetNodeInfo(2, "txsnvhghmrmg4pjm")
fmt.Printf("value: %+v \n", result)
Output:

func GetNodeRule

func GetNodeRule(nodeID int, key string) (*model.Rule, error)

GetNodeRule

func GetUserList

func GetUserList(nodeID int, key string) ([]*model.UserInfo, error)

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

func PostTrigger(nodeID int, key string, trigger model.Trigger) error

when user trigger audit rules then report

func SetHost

func SetHost(host string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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