Documentation
¶
Index ¶
- type APIError
- type APIResponse
- type Allocate
- type Inbound
- type InboundClient
- type RealitySettings
- type ServerStatus
- type Settings
- type Sniffing
- type StreamSettings
- type TcpSettings
- type XUIClient
- func (c *XUIClient) AddClient(inboundId int, inboundClient *InboundClient) error
- func (c *XUIClient) DeleteClient(inboundId int, clientUuid string) error
- func (c *XUIClient) GetClientByEmail(email string) (*InboundClient, error)
- func (c *XUIClient) GetIP() (string, error)
- func (c *XUIClient) GetInbound(inboundId int) (*Inbound, error)
- func (c *XUIClient) GetInbounds() ([]*Inbound, error)
- func (c *XUIClient) GetStatus() (*ServerStatus, error)
- func (c *XUIClient) UpdateClient(inboundId int, clientUuid string, inboundClient *InboundClient) error
- type XUICore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse[T any] struct { Success bool `json:"success"` Msg string `json:"msg"` Obj T `json:"obj,omitempty"` }
func (*APIResponse[T]) Err ¶
func (response *APIResponse[T]) Err(method string) error
type Allocate ¶
type Allocate struct {
Strategy string `json:"strategy"`
Refresh int `json:"refresh"`
Concurrency int `json:"concurrency"`
}
func (*Allocate) UnmarshalJSON ¶
type Inbound ¶
type Inbound struct {
ID int `json:"id"`
Up int `json:"up"`
Down int `json:"down"`
Total int `json:"total"`
Remark string `json:"remark"`
Enable bool `json:"enable"`
ExpiryTime int64 `json:"expiryTime"`
ClientStats interface{} `json:"clientStats"`
Listen string `json:"listen"`
Port int `json:"port"`
Protocol string `json:"protocol"`
Settings *Settings `json:"settings"`
StreamSettings *StreamSettings `json:"streamSettings"`
Tag string `json:"tag"`
Sniffing *Sniffing `json:"sniffing"`
Allocate *Allocate `json:"allocate"`
}
type InboundClient ¶
type InboundClient struct {
Comment string `json:"comment"`
Email string `json:"email,omitempty"`
Password string `json:"password,omitempty"`
Enable bool `json:"enable"`
ExpiryTime int64 `json:"expiryTime,omitempty"`
Flow string `json:"flow,omitempty"`
ID string `json:"id,omitempty"`
LimitIp int `json:"limitIp,omitempty"`
Reset int `json:"reset,omitempty"`
SubId string `json:"subId,omitempty"`
TgId any `json:"tgId,omitempty"`
TotalGB int `json:"totalGB,omitempty"`
}
type RealitySettings ¶
type RealitySettings struct {
Show bool `json:"show"`
Xver int `json:"xver"`
Dest string `json:"dest"`
ServerNames []string `json:"serverNames"`
PrivateKey string `json:"privateKey"`
MinClient string `json:"minClient"`
MaxClient string `json:"maxClient"`
MaxTimediff int `json:"maxTimediff"`
ShortIds []string `json:"shortIds"`
Settings struct {
PublicKey string `json:"publicKey"`
Fingerprint string `json:"fingerprint"`
ServerName string `json:"serverName"`
SpiderX string `json:"spiderX"`
} `json:"settings"`
}
type ServerStatus ¶
type ServerStatus struct {
Cpu float64 `json:"cpu"`
CpuCores int `json:"cpuCores"`
CpuSpeedMhz float64 `json:"cpuSpeedMhz"`
Mem struct {
Current uint64 `json:"current"`
Total uint64 `json:"total"`
} `json:"mem"`
Swap struct {
Current uint64 `json:"current"`
Total uint64 `json:"total"`
} `json:"swap"`
Disk struct {
Current uint64 `json:"current"`
Total uint64 `json:"total"`
} `json:"disk"`
Xray struct {
State string `json:"state"`
ErrorMsg string `json:"errorMsg"`
Version string `json:"version"`
} `json:"xray"`
Uptime uint64 `json:"uptime"`
Loads []float64 `json:"loads"`
TcpCount int `json:"tcpCount"`
UdpCount int `json:"udpCount"`
NetIO struct {
Up uint64 `json:"up"`
Down uint64 `json:"down"`
} `json:"netIO"`
NetTraffic struct {
Sent uint64 `json:"sent"`
Recv uint64 `json:"recv"`
} `json:"netTraffic"`
PublicIP struct {
IPv4 string `json:"ipv4"`
IPv6 string `json:"ipv6"`
} `json:"publicIP"`
AppStats struct {
Threads uint32 `json:"threads"`
Mem uint64 `json:"mem"`
Uptime uint64 `json:"uptime"`
} `json:"appStats"`
}
type Settings ¶
type Settings struct {
Clients []*InboundClient `json:"clients"`
Decryption string `json:"decryption"`
Fallbacks []interface{} `json:"fallbacks"`
}
func (*Settings) UnmarshalJSON ¶
type Sniffing ¶
type Sniffing struct {
Enabled bool `json:"enabled"`
DestOverride []string `json:"destOverride"`
MetadataOnly bool `json:"metadataOnly"`
RouteOnly bool `json:"routeOnly"`
}
func (*Sniffing) UnmarshalJSON ¶
type StreamSettings ¶
type StreamSettings struct {
Network string `json:"network"`
Security string `json:"security"`
ExternalProxy []interface{} `json:"externalProxy"`
RealitySettings RealitySettings `json:"realitySettings"`
TcpSettings TcpSettings `json:"tcpSettings"`
}
func (*StreamSettings) UnmarshalJSON ¶
func (ss *StreamSettings) UnmarshalJSON(data []byte) error
type TcpSettings ¶
type XUIClient ¶
type XUIClient struct {
// contains filtered or unexported fields
}
func (*XUIClient) AddClient ¶
func (c *XUIClient) AddClient(inboundId int, inboundClient *InboundClient) error
func (*XUIClient) DeleteClient ¶
func (*XUIClient) GetClientByEmail ¶
func (c *XUIClient) GetClientByEmail(email string) (*InboundClient, error)
func (*XUIClient) GetInbounds ¶
func (*XUIClient) GetStatus ¶
func (c *XUIClient) GetStatus() (*ServerStatus, error)
func (*XUIClient) UpdateClient ¶
func (c *XUIClient) UpdateClient(inboundId int, clientUuid string, inboundClient *InboundClient) error
Click to show internal directories.
Click to hide internal directories.