client

package
v0.0.0-...-d00ae73 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var Host = core.GetApp().Host() + "/api/ssr/v1"

Functions

func GetNodeInfo

func GetNodeInfo() (*model.NodeInfo, error)

GetNodeInfo Get Node Info

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

func GetNodeRule

func GetNodeRule() (*model.Rule, error)

GetNodeRule Get Node Rule

func GetUserList

func GetUserList() ([]*model.UserInfo, error)

GetUserList Get User List

Example
Host = "http://dash.kitami.ml"
logrus.SetLevel(logrus.DebugLevel)
result, _ := GetUserList()
fmt.Printf("value: %+v\n", result)
Output:

func PostAllUserTraffic

func PostAllUserTraffic(allUserTraffic []*model.UserTraffic) error
Example
Host = "http://localhost"
logrus.SetLevel(logrus.DebugLevel)
PostAllUserTraffic([]*model.UserTraffic{
	{
		1, 200, 200, 0, 0,
	},
})
Output:

func PostNodeOnline

func PostNodeOnline(nodeOnline []*model.NodeOnline) error
Example
Host = "http://localhost"
logrus.SetLevel(logrus.DebugLevel)
PostNodeOnline([]*model.NodeOnline{
	{
		1,
		"192.168.1.1",
	},
})
Output:

func PostNodeStatus

func PostNodeStatus(status model.NodeStatus) 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,
})
Output:

func PostTrigger

func PostTrigger(trigger model.Trigger) error

PostTrigger when user trigger audit rules then report

Types

This section is empty.

Jump to

Keyboard shortcuts

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