panel

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiPath    = "Aiko"
	ApiType    = "api"
	ApiVersion = "v1"
	ApiServer  = "server"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig struct {
	PushInterval any `json:"push_interval"`
	PullInterval any `json:"pull_interval"`
}

type Client

type Client struct {
	APIHost       string
	Key           string
	NodeType      string
	NodeId        int
	LocalRuleList []*regexp.Regexp
	// contains filtered or unexported fields
}

func New

func New(c *conf.ApiConfig) (*Client, error)

func (*Client) Debug

func (c *Client) Debug()

Debug set the client debug for client

func (*Client) GetNodeInfo

func (c *Client) GetNodeInfo() (nodeInfo *NodeInfo, err error)

func (*Client) GetUserList

func (c *Client) GetUserList() (UserList []UserInfo, err error)

GetUserList will pull user form sspanel

func (*Client) ReportUserTraffic

func (c *Client) ReportUserTraffic(userTraffic []UserTraffic) error

ReportUserTraffic reports the user traffic

type NodeInfo

type NodeInfo struct {
	NodeId          int              `json:"-"`
	NodeType        string           `json:"-"`
	Rules           []*regexp.Regexp `json:"-"`
	Host            string           `json:"host"`
	ServerPort      int              `json:"server_port"`
	ServerName      string           `json:"server_name"`
	Network         string           `json:"network"`
	NetworkSettings json.RawMessage  `json:"networkSettings"`
	Cipher          string           `json:"cipher"`
	ServerKey       string           `json:"server_key"`
	Tls             int              `json:"tls"`
	Routes          []Route          `json:"routes"`
	BaseConfig      *BaseConfig      `json:"base_config"`
}

type OnlineUser

type OnlineUser struct {
	UID int
	IP  string
}

type Route

type Route struct {
	Id     int         `json:"id"`
	Match  interface{} `json:"match"`
	Action string      `json:"action"`
}

type UserInfo

type UserInfo struct {
	Id         int    `json:"id"`
	Uuid       string `json:"uuid"`
	SpeedLimit int    `json:"speed_limit"`
	Traffic    int64  `json:"-"`
}

type UserListBody

type UserListBody struct {
	//Msg  string `json:"msg"`
	Users []UserInfo `json:"users"`
}

type UserTraffic

type UserTraffic struct {
	UID      int
	Upload   int64
	Download int64
}

Jump to

Keyboard shortcuts

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