api

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetNodeInfo() (nodeInfo *NodeInfo, err error)
	GetTransitNodeInfo() (transitnodeinfo *TransitNodeInfo, err error)
	GetUserList() (userList *[]UserInfo, err error)
	ReportNodeStatus(nodeStatus *NodeStatus) (err error)
	ReportNodeOnlineUsers(onlineUser *[]OnlineUser) (err error)
	ReportUserTraffic(userTraffic *[]UserTraffic) (err error)
	Describe() ClientInfo
	GetNodeRule() (ruleList *[]DetectRule, err error)
	ReportIllegal(detectResultList *[]DetectResult) (err error)
	Debug()
}

type ClientInfo

type ClientInfo struct {
	APIHost string
	NodeID  int
	Key     string
}

type Config

type Config struct {
	APIHost      string  `mapstructure:"ApiHost"`
	NodeID       int     `mapstructure:"NodeID"`
	Key          string  `mapstructure:"ApiKey"`
	Timeout      int     `mapstructure:"Timeout"`
	SpeedLimit   float64 `mapstructure:"SpeedLimit"`
	DeviceLimit  int     `mapstructure:"DeviceLimit"`
	RuleListPath string  `mapstructure:"RuleListPath"`
}

API config

type DetectResult

type DetectResult struct {
	UID    int
	RuleID int
}

type DetectRule

type DetectRule struct {
	ID      int
	Pattern *regexp.Regexp
}

type NodeInfo

type NodeInfo struct {
	NodeType          string
	NodeID            int
	Port              uint32
	SpeedLimit        uint64 // Bps
	AlterID           uint16
	TransportProtocol string
	Host              string
	Path              string
	EnableTLS         bool
	TLSType           string
	CypherMethod      string
	ServiceName       string
	HeaderType        string
	AllowInsecure     bool
	RelayNodeID       int
	ListenIP          string
	ProxyProtocol     bool
	Sniffing          bool
	Address           string
	Fingerprint       string
	RejectUnknownSNI  bool
	Quic_security     string
	Quic_key          string
}

type NodeStatus

type NodeStatus struct {
	CPU    float64
	Mem    float64
	Disk   float64
	Uptime uint64
}

Node status

type OnlineUser

type OnlineUser struct {
	UID int
	IP  string
}

type TransitNodeInfo

type TransitNodeInfo struct {
	NodeType          string
	NodeID            int
	Port              uint32
	SpeedLimit        uint64 // Bps
	AlterID           uint16
	TransportProtocol string
	Host              string
	Path              string
	EnableTLS         bool
	TLSType           string
	CypherMethod      string
	ServiceName       string
	HeaderType        string
	AllowInsecure     bool
	Address           string
	ListenIP          string
	ProxyProtocol     bool
	Sniffing          bool
	Flow              string
	Fingerprint       string
	RejectUnknownSNI  bool
	Quic_security     string
	Quic_key          string
}

type UserInfo

type UserInfo struct {
	UID         int
	Email       string
	Passwd      string
	Port        int
	SpeedLimit  uint64
	DeviceLimit int
	UUID        string
}

type UserTraffic

type UserTraffic struct {
	UID      int
	Email    string
	Upload   int64
	Download int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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