Documentation
¶
Index ¶
- func GetBinaryName() string
- func GetBinaryPath() string
- func GetConfigPath() string
- func GetGeoipPath() string
- func GetGeositePath() string
- type ClientTraffic
- type Config
- type InboundConfig
- type LogWriter
- type Process
- func (p *Process) GetAPIPort() int
- func (p *Process) GetConfig() *Config
- func (p Process) GetErr() error
- func (p *Process) GetOnlineClients() []string
- func (p Process) GetResult() string
- func (p *Process) GetUptime() uint64
- func (p Process) GetVersion() string
- func (p Process) IsRunning() bool
- func (p *Process) SetOnlineClients(users []string)
- func (p Process) Start() (err error)
- func (p Process) Stop() error
- type Traffic
- type XrayAPI
- func (x *XrayAPI) AddInbound(inbound []byte) error
- func (x *XrayAPI) AddUser(Protocol string, inboundTag string, user map[string]interface{}) error
- func (x *XrayAPI) Close()
- func (x *XrayAPI) DelInbound(tag string) error
- func (x *XrayAPI) GetOnlineUsers() ([]string, error)
- func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error)
- func (x *XrayAPI) Init(apiPort int) (err error)
- func (x *XrayAPI) RemoveUser(inboundTag string, email string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBinaryName ¶
func GetBinaryName() string
func GetBinaryPath ¶
func GetBinaryPath() string
func GetConfigPath ¶
func GetConfigPath() string
func GetGeoipPath ¶
func GetGeoipPath() string
func GetGeositePath ¶
func GetGeositePath() string
Types ¶
type ClientTraffic ¶
type ClientTraffic struct {
Id int `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
InboundId int `json:"inboundId" form:"inboundId"`
Enable bool `json:"enable" form:"enable"`
Email string `json:"email" form:"email" gorm:"unique"`
Up int64 `json:"up" form:"up"`
Down int64 `json:"down" form:"down"`
ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`
Total int64 `json:"total" form:"total"`
Reset int `json:"reset" form:"reset" gorm:"default:0"`
}
type Config ¶
type Config struct {
LogConfig json_util.RawMessage `json:"log"`
RouterConfig json_util.RawMessage `json:"routing"`
DNSConfig json_util.RawMessage `json:"dns"`
InboundConfigs []InboundConfig `json:"inbounds"`
OutboundConfigs json_util.RawMessage `json:"outbounds"`
Transport json_util.RawMessage `json:"transport"`
Policy json_util.RawMessage `json:"policy"`
API json_util.RawMessage `json:"api"`
Stats json_util.RawMessage `json:"stats"`
Reverse json_util.RawMessage `json:"reverse"`
FakeDNS json_util.RawMessage `json:"fakedns"`
Observatory json_util.RawMessage `json:"observatory"`
BurstObservatory json_util.RawMessage `json:"burstObservatory"`
Metrics json_util.RawMessage `json:"metrics"`
}
type InboundConfig ¶
type InboundConfig struct {
Listen json_util.RawMessage `json:"listen"` // listen cannot be an empty string
Port int `json:"port"`
Protocol string `json:"protocol"`
Settings json_util.RawMessage `json:"settings"`
StreamSettings json_util.RawMessage `json:"streamSettings"`
Tag string `json:"tag"`
Sniffing json_util.RawMessage `json:"sniffing"`
}
func (*InboundConfig) Equals ¶
func (c *InboundConfig) Equals(other *InboundConfig) bool
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
func NewLogWriter ¶
func NewLogWriter() *LogWriter
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
func NewProcess ¶
func (*Process) GetAPIPort ¶
func (*Process) GetOnlineClients ¶
func (Process) GetVersion ¶
func (p Process) GetVersion() string
func (*Process) SetOnlineClients ¶
type XrayAPI ¶
type XrayAPI struct {
HandlerServiceClient *command.HandlerServiceClient
StatsServiceClient *statsService.StatsServiceClient
// contains filtered or unexported fields
}
func (*XrayAPI) AddInbound ¶
func (*XrayAPI) DelInbound ¶
func (*XrayAPI) GetOnlineUsers ¶
func (*XrayAPI) GetTraffic ¶
func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error)
Click to show internal directories.
Click to hide internal directories.