Documentation ¶
Index ¶
- Variables
- func AsConfig[T NodeConfig](nc NodeConfig) (T, error)
- func MarshalTrafficStats(stats *TrafficStats) ([]byte, error)
- func MarshalTraffics(traffics []*UserTraffic) ([]byte, error)
- func UnmarshalUsers(data []byte) (*[]User, error)
- type Client
- func (c *Client) Config(nodeId NodeId, nodeType NodeType) (config NodeConfig, err error)
- func (c *Client) Debug(enable bool)
- func (c *Client) Heartbeat(nodeId NodeId, nodeType NodeType, nodeIp string) error
- func (c *Client) RawConfig(nodeId NodeId, nodeType NodeType) (rawData []byte, err error)
- func (c *Client) RawUsers(nodeId NodeId, nodeType NodeType) (rawData []byte, hash string, err error)
- func (c *Client) Submit(nodeId NodeId, nodeType NodeType, userTraffic []*UserTraffic) error
- func (c *Client) SubmitStatsWithAgent(nodeId NodeId, nodeType NodeType, nodeIp string, stats *TrafficStats) error
- func (c *Client) SubmitWithAgent(nodeId NodeId, nodeType NodeType, userTraffic []*UserTraffic) error
- func (c *Client) Users(nodeId NodeId, nodeType NodeType) (UserList *[]User, hash string, err error)
- type Config
- type Hysteria2Config
- type HysteriaConfig
- type NodeConfig
- type NodeId
- type NodeType
- type RespConfig
- type RespHeartBeat
- type RespSubmit
- type RespSubmitStatsWithAgent
- type RespSubmitWithAgent
- type RespUsers
- type ShadowsocksConfig
- type TrafficStats
- type TrojanConfig
- type User
- type UserTraffic
- type VMessConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorUserNotModified = errors.New("users not modified")
)
Functions ¶
func AsConfig ¶
func AsConfig[T NodeConfig](nc NodeConfig) (T, error)
func MarshalTrafficStats ¶ added in v0.0.7
func MarshalTrafficStats(stats *TrafficStats) ([]byte, error)
func MarshalTraffics ¶ added in v0.0.7
func MarshalTraffics(traffics []*UserTraffic) ([]byte, error)
func UnmarshalUsers ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client APIClient create a api client to the panel.
func (*Client) Config ¶
func (c *Client) Config(nodeId NodeId, nodeType NodeType) (config NodeConfig, err error)
func (*Client) Submit ¶
func (c *Client) Submit(nodeId NodeId, nodeType NodeType, userTraffic []*UserTraffic) error
Submit reports the user traffic
func (*Client) SubmitStatsWithAgent ¶
func (*Client) SubmitWithAgent ¶
func (c *Client) SubmitWithAgent(nodeId NodeId, nodeType NodeType, userTraffic []*UserTraffic) error
type Hysteria2Config ¶
type Hysteria2Config struct { ID int `json:"id"` ServerPort int `json:"server_port"` Obfs string `json:"obfs"` UpMbps int `json:"up_mbps"` DownMbps int `json:"down_mbps"` IgnoreCliBandWidth bool `json:"ignore_cli_band_width"` DisableUDP bool `json:"disable_udp"` }
func AsHysteria2Config ¶
func AsHysteria2Config(nc NodeConfig) (*Hysteria2Config, error)
func UnmarshalHysteria2Config ¶
func UnmarshalHysteria2Config(data []byte) (*Hysteria2Config, error)
func (*Hysteria2Config) String ¶
func (n *Hysteria2Config) String() string
func (*Hysteria2Config) TypeName ¶
func (n *Hysteria2Config) TypeName() string
type HysteriaConfig ¶
type HysteriaConfig struct { ID int `json:"id"` ServerPort int `json:"server_port"` Protocol string `json:"protocol"` Obfs string `json:"obfs"` UpMbps int `json:"up_mbps"` DownMbps int `json:"down_mbps"` DisableMTUDiscovery bool `json:"disable_mtu_discovery"` DisableUdp bool `json:"disable_udp"` }
func AsHysteriaConfig ¶
func AsHysteriaConfig(nc NodeConfig) (*HysteriaConfig, error)
func UnmarshalHysteriaConfig ¶
func UnmarshalHysteriaConfig(data []byte) (*HysteriaConfig, error)
func (*HysteriaConfig) String ¶
func (n *HysteriaConfig) String() string
func (*HysteriaConfig) TypeName ¶
func (n *HysteriaConfig) TypeName() string
type NodeConfig ¶
type RespConfig ¶
type RespConfig struct { Data NodeConfig `json:"data"` Message string `json:"message"` }
type RespHeartBeat ¶
type RespHeartBeat RespSubmit
type RespSubmit ¶
type RespSubmitStatsWithAgent ¶
type RespSubmitStatsWithAgent RespSubmit
type RespSubmitWithAgent ¶
type RespSubmitWithAgent RespSubmit
type ShadowsocksConfig ¶
type ShadowsocksConfig struct { ID int `json:"id"` ServerPort int `json:"server_port"` Method string `json:"method"` Network string `json:"network"` }
func AsShadowsocksConfig ¶
func AsShadowsocksConfig(nc NodeConfig) (*ShadowsocksConfig, error)
func UnmarshalShadowsocksConfig ¶
func UnmarshalShadowsocksConfig(data []byte) (*ShadowsocksConfig, error)
func (*ShadowsocksConfig) String ¶
func (n *ShadowsocksConfig) String() string
func (*ShadowsocksConfig) TypeName ¶
func (n *ShadowsocksConfig) TypeName() string
type TrafficStats ¶
type TrojanConfig ¶
type TrojanConfig struct { ID int `json:"id"` ServerPort int `json:"server_port"` AllowInsecure int `json:"allow_insecure"` ServerName string `json:"server_name"` Network string `json:"network"` WebSocketConfig *xray.WebSocketConfig `json:"ws_settings,omitempty"` GrpcConfig *xray.GRPCConfig `json:"grpc_settings,omitempty"` }
func AsTrojanConfig ¶
func AsTrojanConfig(nc NodeConfig) (*TrojanConfig, error)
func UnmarshalTrojanConfig ¶
func UnmarshalTrojanConfig(data []byte) (*TrojanConfig, error)
func (*TrojanConfig) String ¶
func (n *TrojanConfig) String() string
func (*TrojanConfig) TypeName ¶
func (n *TrojanConfig) TypeName() string
type UserTraffic ¶
type VMessConfig ¶
type VMessConfig struct { ID int `json:"id"` ServerPort int `json:"server_port"` TLS int `json:"tls"` Network string `json:"network"` TlsConfig *xray.TLSConfig `json:"tls_settings"` WebSocketConfig *xray.WebSocketConfig `json:"ws_settings,omitempty"` H2Config *xray.HTTPConfig `json:"h2_config"` TcpConfig *xray.TCPConfig `json:"tcp_settings,omitempty"` GrpcConfig *xray.GRPCConfig `json:"grpc_settings,omitempty"` RouterSettings *xray.RouterConfig `json:"router_settings,omitempty"` DnsSettings *xray.DNSConfig `json:"dns_settings,omitempty"` }
func AsVMessConfig ¶
func AsVMessConfig(nc NodeConfig) (*VMessConfig, error)
func UnmarshalVMessConfig ¶
func UnmarshalVMessConfig(data []byte) (*VMessConfig, error)
func (*VMessConfig) String ¶
func (n *VMessConfig) String() string
func (*VMessConfig) TypeName ¶
func (n *VMessConfig) TypeName() string
Click to show internal directories.
Click to hide internal directories.