bunpanel

package
v0.9.2-20240320 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MPL-2.0 Imports: 14 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
	LastReportOnline map[int]int
	// contains filtered or unexported fields
}

func New

func New(apiConfig *api.Config) *APIClient

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)

func (*APIClient) GetNodeRule

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

GetNodeRule implements api.API.

func (*APIClient) GetUserList

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

func (*APIClient) ParseNodeInfo

func (c *APIClient) ParseNodeInfo(nodeInfoResponse *Server) (*api.NodeInfo, error)

func (*APIClient) ParseUserListResponse

func (c *APIClient) ParseUserListResponse(userInfoResponse *[]User) (*[]api.UserInfo, error)

func (*APIClient) ReportIllegal

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

ReportIllegal implements api.API.

func (*APIClient) ReportNodeOnlineUsers

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

func (*APIClient) ReportNodeStatus

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

ReportNodeStatus implements api.API.

func (*APIClient) ReportUserTraffic

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

type GrpcSettigns

type GrpcSettigns struct {
	ServiceName string `json:"serviceName"`
}

type OnlineUser

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

type PostData

type PostData struct {
	Data interface{} `json:"data"`
}

type RealitySettings

type RealitySettings struct {
	Show             bool     `json:"show"`
	Dest             string   `json:"dest"`
	Xver             uint64   `json:"xver"`
	ServerNames      []string `json:"serverNames"`
	PrivateKey       string   `json:"privateKey"`
	MinClientVer     string   `json:"minClientVer"`
	MaxClientVer     string   `json:"maxClientVer"`
	MaxTimeDiff      uint64   `json:"maxTimeDiff"`
	ProxyProtocolVer uint64   `json:"proxyProtocolVer"`
	ShortIds         []string `json:"shortIds"`
}

type Response

type Response struct {
	StatusCode int             `json:"statusCode"`
	Datas      json.RawMessage `json:"datas"`
}

type Server

type Server struct {
	Port            int             `json:"serverPort"`
	Network         string          `json:"network"`
	Method          string          `json:"method"`
	Security        string          `json:"security"`
	Flow            string          `json:"flow"`
	WsSettings      json.RawMessage `json:"wsSettings"`
	RealitySettings json.RawMessage `json:"realitySettings"`
	GrpcSettings    json.RawMessage `json:"grpcSettings"`
	TcpSettings     json.RawMessage `json:"tcpSettings"`
}

type TcpSettings

type TcpSettings struct {
	Header json.RawMessage `json:"header"`
}

type User

type User struct {
	ID          int     `json:"id"`
	UUID        string  `json:"uuid"`
	SpeedLimit  float64 `json:"speedLimit"`
	DeviceLimit int     `json:"ipLimit"`
	AliveIP     int     `json:"onlineIp"`
}

type UserTraffic

type UserTraffic struct {
	UID      int   `json:"userId"`
	Upload   int64 `json:"u"`
	Download int64 `json:"d"`
}

UserTraffic is the data structure of traffic

type WsSettings

type WsSettings struct {
	Path    string `json:"path"`
	Headers struct {
		Host string `json:"Host"`
	} `json:"headers"`
}

Jump to

Keyboard shortcuts

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