panel

package
v0.0.0-...-af9fb20 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None    = 0
	Tls     = 1
	Reality = 2
)

Security type

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
	Token    string
	NodeType string
	NodeId   int
	// 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() (node *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 CommonNode

type CommonNode struct {
	Host       string      `json:"host"`
	ServerPort int         `json:"server_port"`
	ServerName string      `json:"server_name"`
	Routes     []Route     `json:"routes"`
	BaseConfig *BaseConfig `json:"base_config"`
}

type HysteriaNode

type HysteriaNode struct {
	CommonNode
	UpMbps   int    `json:"up_mbps"`
	DownMbps int    `json:"down_mbps"`
	Obfs     string `json:"obfs"`
}

type NodeInfo

type NodeInfo struct {
	Id           int
	Type         string
	Security     int
	PushInterval time.Duration
	PullInterval time.Duration
	RawDNS       RawDNS
	Rules        Rules

	// origin
	VAllss      *VAllssNode
	Shadowsocks *ShadowsocksNode
	Trojan      *TrojanNode
	Hysteria    *HysteriaNode
	Common      *CommonNode
}

type OnlineUser

type OnlineUser struct {
	UID int
	IP  string
}

type RawDNS

type RawDNS struct {
	DNSMap  map[string]map[string]interface{}
	DNSJson []byte
}

type RealityConfig

type RealityConfig struct {
	Xver         uint64 `json:"Xver"`
	MinClientVer string `json:"MinClientVer"`
	MaxClientVer string `json:"MaxClientVer"`
	MaxTimeDiff  string `json:"MaxTimeDiff"`
}

type Route

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

type Rules

type Rules struct {
	Regexp   []string
	Protocol []string
}

type ShadowsocksNode

type ShadowsocksNode struct {
	CommonNode
	Cipher    string `json:"cipher"`
	ServerKey string `json:"server_key"`
}

type TlsSettings

type TlsSettings struct {
	ServerName string `json:"server_name"`
	ServerPort string `json:"server_port"`
	ShortId    string `json:"short_id"`
	PrivateKey string `json:"private_key"`
}

type TrojanNode

type TrojanNode CommonNode

type UserInfo

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

type UserListBody

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

type UserTraffic

type UserTraffic struct {
	UID      int
	Upload   int64
	Download int64
}

type VAllssNode

type VAllssNode struct {
	CommonNode
	Tls                 int             `json:"tls"`
	TlsSettings         TlsSettings     `json:"tls_settings"`
	TlsSettingsBack     *TlsSettings    `json:"tlsSettings"`
	Network             string          `json:"network"`
	NetworkSettings     json.RawMessage `json:"network_settings"`
	NetworkSettingsBack json.RawMessage `json:"networkSettings"`
	ServerName          string          `json:"server_name"`

	// vless only
	Flow          string        `json:"flow"`
	RealityConfig RealityConfig `json:"-"`
}

VAllssNode is vmess and vless node info

Jump to

Keyboard shortcuts

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