adminapi

package
v0.0.0-...-de015ad Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	APIHost       string
	NodeID        int
	Key           string
	NodeType      string
	EnableVless   bool
	VlessFlow     string
	SpeedLimit    float64
	DeviceLimit   int
	LocalRuleList []api.DetectRule
	// contains filtered or unexported fields
}

APIClient create an api client to the panel.

func New

func New(apiConfig *api.Config) *APIClient

API请求方法 --ok

func (*APIClient) Debug

func (c *APIClient) Debug()

Debug set the client debug for client

func (*APIClient) Describe

func (c *APIClient) Describe() api.ClientInfo

Describe return a description of the client

func (*APIClient) GetNodeInfo

func (c *APIClient) GetNodeInfo() (nodeInfo *api.NodeInfo, err error)

GetNodeInfo 将从面板中提取 NodeInfo 配置 --ok

func (*APIClient) GetNodeRule

func (c *APIClient) GetNodeRule() (*[]api.DetectRule, error)

GetNodeRule 获取审计规则

func (*APIClient) GetUserList

func (c *APIClient) GetUserList() (UserList *[]api.UserInfo, err error)

GetUserList 拉取可用用户 --ok

func (*APIClient) ReportIllegal

func (c *APIClient) ReportIllegal(detectResultList *[]api.DetectResult) error

ReportIllegal 审计规则上报

func (*APIClient) ReportNodeOnlineUsers

func (c *APIClient) ReportNodeOnlineUsers(onlineUserList *[]api.OnlineUser) error

ReportNodeOnlineUsers 提交节点在线用户

func (*APIClient) ReportNodeStatus

func (c *APIClient) ReportNodeStatus(nodeStatus *api.NodeStatus) (err error)

ReportNodeStatus 上报节点服务器状态

func (*APIClient) ReportUserTraffic

func (c *APIClient) ReportUserTraffic(userTraffic *[]api.UserTraffic) error

ReportUserTraffic 上报使用情况

type NodeStatus

type NodeStatus struct {
	CPU    string `json:"cpu"`
	Memory string `json:"memory"`
	Net    string `json:"net"`
	Disk   string `json:"disk"`
	Uptime int    `json:"uptime"`
}

type OnlineUser

type OnlineUser struct {
	UID int    `json:"UserNo"`
	IP  string `json:"IP"`
}

type PostData

type PostData struct {
	Users   interface{} `json:"users"`
	Onlines interface{} `json:"onlines"`
}

type UserTraffic

type UserTraffic struct {
	UID      int   `json:"userno"`
	Upload   int64 `json:"upload"`
	Download int64 `json:"download"`
}

Jump to

Keyboard shortcuts

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