Documentation
¶
Index ¶
- func RemoveIndex(s []interface{}, index int) []interface{}
- type InboundService
- func (s *InboundService) AddClientStat(tx *gorm.DB, inboundId int, client *model.Client) error
- func (s *InboundService) AddInbound(inbound *model.Inbound) (*model.Inbound, bool, error)
- func (s *InboundService) AddInboundClient(data *model.Inbound) (bool, error)
- func (s *InboundService) AddTraffic(inboundTraffics []*xray.Traffic, clientTraffics []*xray.ClientTraffic) (error, bool)
- func (s *InboundService) DelClientStat(tx *gorm.DB, email string) error
- func (s *InboundService) DelDepletedClients(id int) (err error)
- func (s *InboundService) DelInbound(id int) (bool, error)
- func (s *InboundService) DelInboundClient(inboundId int, clientId string) (bool, error)
- func (s *InboundService) GetAllInbounds() ([]*model.Inbound, error)
- func (s *InboundService) GetClientTrafficByEmail(email string) (traffic *xray.ClientTraffic, err error)
- func (s *InboundService) GetClientTrafficByID(id string) ([]xray.ClientTraffic, error)
- func (s *InboundService) GetClientTrafficTgBot(tgid string, tguname string) ([]*xray.ClientTraffic, error)
- func (s *InboundService) GetClients(inbound *model.Inbound) ([]model.Client, error)
- func (s *InboundService) GetInbound(id int) (*model.Inbound, error)
- func (s *InboundService) GetInboundTags() (string, error)
- func (s *InboundService) GetInbounds(userId int) ([]*model.Inbound, error)
- func (s *InboundService) GetOnlineClients() []string
- func (s *InboundService) MigrateDB()
- func (s *InboundService) MigrationRemoveOrphanedTraffics()
- func (s *InboundService) MigrationRequirements()
- func (s *InboundService) ResetAllClientTraffics(id int) error
- func (s *InboundService) ResetAllTraffics() error
- func (s *InboundService) ResetClientTraffic(id int, clientEmail string) (bool, error)
- func (s *InboundService) SearchClientTraffic(query string) (traffic *xray.ClientTraffic, err error)
- func (s *InboundService) SearchInbounds(query string) ([]*model.Inbound, error)
- func (s *InboundService) UpdateClientStat(tx *gorm.DB, email string, client *model.Client) error
- func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound, bool, error)
- func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId string) (bool, error)
- type LoginStatus
- type PanelService
- type ProcessState
- type Release
- type ServerService
- func (s *ServerService) GetConfigJson() (interface{}, error)
- func (s *ServerService) GetDb() ([]byte, error)
- func (s *ServerService) GetLogs(count string, level string, syslog string) []string
- func (s *ServerService) GetNewEchCert(sni string) (interface{}, error)
- func (s *ServerService) GetNewVlessEnc() (any, error)
- func (s *ServerService) GetNewX25519Cert() (interface{}, error)
- func (s *ServerService) GetNewmldsa65() (any, error)
- func (s *ServerService) GetStatus(lastStatus *Status) *Status
- func (s *ServerService) GetXrayVersions() ([]string, error)
- func (s *ServerService) ImportDB(file multipart.File) error
- func (s *ServerService) RestartXrayService() (string error)
- func (s *ServerService) StopXrayService() (string error)
- func (s *ServerService) UpdateXray(version string) error
- type SettingService
- func (s *SettingService) GetAllSetting() (*entity.AllSetting, error)
- func (s *SettingService) GetBasePath() (string, error)
- func (s *SettingService) GetCertFile() (string, error)
- func (s *SettingService) GetDefaultSettings(host string) (interface{}, error)
- func (s *SettingService) GetDefaultXrayConfig() (interface{}, error)
- func (s *SettingService) GetExpireDiff() (int, error)
- func (s *SettingService) GetKeyFile() (string, error)
- func (s *SettingService) GetListen() (string, error)
- func (s *SettingService) GetPageSize() (int, error)
- func (s *SettingService) GetPort() (int, error)
- func (s *SettingService) GetRemarkModel() (string, error)
- func (s *SettingService) GetSecret() ([]byte, error)
- func (s *SettingService) GetSessionMaxAge() (int, error)
- func (s *SettingService) GetSubCertFile() (string, error)
- func (s *SettingService) GetSubDomain() (string, error)
- func (s *SettingService) GetSubEnable() (bool, error)
- func (s *SettingService) GetSubEncrypt() (bool, error)
- func (s *SettingService) GetSubJsonFragment() (string, error)
- func (s *SettingService) GetSubJsonMux() (string, error)
- func (s *SettingService) GetSubJsonNoises() (string, error)
- func (s *SettingService) GetSubJsonPath() (string, error)
- func (s *SettingService) GetSubJsonRules() (string, error)
- func (s *SettingService) GetSubJsonURI() (string, error)
- func (s *SettingService) GetSubKeyFile() (string, error)
- func (s *SettingService) GetSubListen() (string, error)
- func (s *SettingService) GetSubPath() (string, error)
- func (s *SettingService) GetSubPort() (int, error)
- func (s *SettingService) GetSubShowInfo() (bool, error)
- func (s *SettingService) GetSubURI() (string, error)
- func (s *SettingService) GetSubUpdates() (string, error)
- func (s *SettingService) GetTgBotBackup() (bool, error)
- func (s *SettingService) GetTgBotChatId() (string, error)
- func (s *SettingService) GetTgBotLoginNotify() (bool, error)
- func (s *SettingService) GetTgBotToken() (string, error)
- func (s *SettingService) GetTgCpu() (int, error)
- func (s *SettingService) GetTgLang() (string, error)
- func (s *SettingService) GetTgbotRuntime() (string, error)
- func (s *SettingService) GetTgbotenabled() (bool, error)
- func (s *SettingService) GetTimeLocation() (*time.Location, error)
- func (s *SettingService) GetTrafficDiff() (int, error)
- func (s *SettingService) GetWarp() (string, error)
- func (s *SettingService) GetWebDomain() (string, error)
- func (s *SettingService) GetXrayConfigTemplate() (string, error)
- func (s *SettingService) ResetSettings() error
- func (s *SettingService) SetBasePath(basePath string) error
- func (s *SettingService) SetCertFile(webCertFile string) error
- func (s *SettingService) SetKeyFile(webKeyFile string) error
- func (s *SettingService) SetPort(port int) error
- func (s *SettingService) SetTgBotChatId(chatIds string) error
- func (s *SettingService) SetTgBotToken(token string) error
- func (s *SettingService) SetTgbotRuntime(time string) error
- func (s *SettingService) SetTgbotenabled(value bool) error
- func (s *SettingService) SetWarp(data string) error
- func (s *SettingService) UpdateAllSetting(allSetting *entity.AllSetting) error
- type Status
- type Tgbot
- func (t *Tgbot) I18nBot(name string, params ...string) string
- func (t *Tgbot) IsRunning() bool
- func (t *Tgbot) NewTgbot() *Tgbot
- func (t *Tgbot) OnReceive()
- func (t *Tgbot) SendAnswer(chatId int64, msg string, isAdmin bool)
- func (t *Tgbot) SendBackupToAdmins()
- func (t *Tgbot) SendMsgToTgbot(tgid int64, msg string, replyMarkup ...tgbotapi.InlineKeyboardMarkup)
- func (t *Tgbot) SendMsgToTgbotAdmins(msg string)
- func (t *Tgbot) SendReport()
- func (t *Tgbot) SetHostname()
- func (t *Tgbot) Start(i18nFS embed.FS) error
- func (t *Tgbot) Stop()
- func (t *Tgbot) UserLoginNotify(username string, ip string, time string, status LoginStatus)
- type UserService
- type WarpService
- type XrayService
- func (s *XrayService) GetXrayConfig() (*xray.Config, error)
- func (s *XrayService) GetXrayErr() error
- func (s *XrayService) GetXrayResult() string
- func (s *XrayService) GetXrayTraffic() ([]*xray.Traffic, []*xray.ClientTraffic, error)
- func (s *XrayService) GetXrayVersion() string
- func (s *XrayService) IsNeedRestartAndSetFalse() bool
- func (s *XrayService) IsXrayRunning() bool
- func (s *XrayService) RestartXray(isForce bool) error
- func (s *XrayService) SetToNeedRestart()
- func (s *XrayService) StopXray() error
- type XraySettingService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveIndex ¶
func RemoveIndex(s []interface{}, index int) []interface{}
Types ¶
type InboundService ¶
type InboundService struct {
// contains filtered or unexported fields
}
func (*InboundService) AddClientStat ¶
func (*InboundService) AddInbound ¶
func (*InboundService) AddInboundClient ¶
func (s *InboundService) AddInboundClient(data *model.Inbound) (bool, error)
func (*InboundService) AddTraffic ¶
func (s *InboundService) AddTraffic(inboundTraffics []*xray.Traffic, clientTraffics []*xray.ClientTraffic) (error, bool)
func (*InboundService) DelClientStat ¶
func (s *InboundService) DelClientStat(tx *gorm.DB, email string) error
func (*InboundService) DelDepletedClients ¶
func (s *InboundService) DelDepletedClients(id int) (err error)
func (*InboundService) DelInbound ¶
func (s *InboundService) DelInbound(id int) (bool, error)
func (*InboundService) DelInboundClient ¶
func (s *InboundService) DelInboundClient(inboundId int, clientId string) (bool, error)
func (*InboundService) GetAllInbounds ¶
func (s *InboundService) GetAllInbounds() ([]*model.Inbound, error)
func (*InboundService) GetClientTrafficByEmail ¶
func (s *InboundService) GetClientTrafficByEmail(email string) (traffic *xray.ClientTraffic, err error)
func (*InboundService) GetClientTrafficByID ¶
func (s *InboundService) GetClientTrafficByID(id string) ([]xray.ClientTraffic, error)
func (*InboundService) GetClientTrafficTgBot ¶
func (s *InboundService) GetClientTrafficTgBot(tgid string, tguname string) ([]*xray.ClientTraffic, error)
func (*InboundService) GetClients ¶
func (*InboundService) GetInbound ¶
func (s *InboundService) GetInbound(id int) (*model.Inbound, error)
func (*InboundService) GetInboundTags ¶
func (s *InboundService) GetInboundTags() (string, error)
func (*InboundService) GetInbounds ¶
func (s *InboundService) GetInbounds(userId int) ([]*model.Inbound, error)
func (*InboundService) GetOnlineClients ¶
func (s *InboundService) GetOnlineClients() []string
func (*InboundService) MigrateDB ¶
func (s *InboundService) MigrateDB()
func (*InboundService) MigrationRemoveOrphanedTraffics ¶
func (s *InboundService) MigrationRemoveOrphanedTraffics()
func (*InboundService) MigrationRequirements ¶
func (s *InboundService) MigrationRequirements()
func (*InboundService) ResetAllClientTraffics ¶
func (s *InboundService) ResetAllClientTraffics(id int) error
func (*InboundService) ResetAllTraffics ¶
func (s *InboundService) ResetAllTraffics() error
func (*InboundService) ResetClientTraffic ¶
func (s *InboundService) ResetClientTraffic(id int, clientEmail string) (bool, error)
func (*InboundService) SearchClientTraffic ¶
func (s *InboundService) SearchClientTraffic(query string) (traffic *xray.ClientTraffic, err error)
func (*InboundService) SearchInbounds ¶
func (s *InboundService) SearchInbounds(query string) ([]*model.Inbound, error)
func (*InboundService) UpdateClientStat ¶
func (*InboundService) UpdateInbound ¶
func (*InboundService) UpdateInboundClient ¶
type LoginStatus ¶
type LoginStatus byte
const ( LoginSuccess LoginStatus = 1 LoginFail LoginStatus = 0 )
type PanelService ¶
type PanelService struct{}
func (*PanelService) RestartPanel ¶
func (s *PanelService) RestartPanel(delay time.Duration) error
type ProcessState ¶
type ProcessState string
const ( Running ProcessState = "Running" Stop ProcessState = "Stop" Error ProcessState = "Error" )
type ServerService ¶
type ServerService struct {
// contains filtered or unexported fields
}
func (*ServerService) GetConfigJson ¶
func (s *ServerService) GetConfigJson() (interface{}, error)
func (*ServerService) GetDb ¶
func (s *ServerService) GetDb() ([]byte, error)
func (*ServerService) GetLogs ¶
func (s *ServerService) GetLogs(count string, level string, syslog string) []string
func (*ServerService) GetNewEchCert ¶
func (s *ServerService) GetNewEchCert(sni string) (interface{}, error)
func (*ServerService) GetNewVlessEnc ¶
func (s *ServerService) GetNewVlessEnc() (any, error)
func (*ServerService) GetNewX25519Cert ¶
func (s *ServerService) GetNewX25519Cert() (interface{}, error)
func (*ServerService) GetNewmldsa65 ¶
func (s *ServerService) GetNewmldsa65() (any, error)
func (*ServerService) GetStatus ¶
func (s *ServerService) GetStatus(lastStatus *Status) *Status
func (*ServerService) GetXrayVersions ¶
func (s *ServerService) GetXrayVersions() ([]string, error)
func (*ServerService) RestartXrayService ¶
func (s *ServerService) RestartXrayService() (string error)
func (*ServerService) StopXrayService ¶
func (s *ServerService) StopXrayService() (string error)
func (*ServerService) UpdateXray ¶
func (s *ServerService) UpdateXray(version string) error
type SettingService ¶
type SettingService struct{}
func (*SettingService) GetAllSetting ¶
func (s *SettingService) GetAllSetting() (*entity.AllSetting, error)
func (*SettingService) GetBasePath ¶
func (s *SettingService) GetBasePath() (string, error)
func (*SettingService) GetCertFile ¶
func (s *SettingService) GetCertFile() (string, error)
func (*SettingService) GetDefaultSettings ¶
func (s *SettingService) GetDefaultSettings(host string) (interface{}, error)
func (*SettingService) GetDefaultXrayConfig ¶
func (s *SettingService) GetDefaultXrayConfig() (interface{}, error)
func (*SettingService) GetExpireDiff ¶
func (s *SettingService) GetExpireDiff() (int, error)
func (*SettingService) GetKeyFile ¶
func (s *SettingService) GetKeyFile() (string, error)
func (*SettingService) GetListen ¶
func (s *SettingService) GetListen() (string, error)
func (*SettingService) GetPageSize ¶
func (s *SettingService) GetPageSize() (int, error)
func (*SettingService) GetPort ¶
func (s *SettingService) GetPort() (int, error)
func (*SettingService) GetRemarkModel ¶
func (s *SettingService) GetRemarkModel() (string, error)
func (*SettingService) GetSecret ¶
func (s *SettingService) GetSecret() ([]byte, error)
func (*SettingService) GetSessionMaxAge ¶
func (s *SettingService) GetSessionMaxAge() (int, error)
func (*SettingService) GetSubCertFile ¶
func (s *SettingService) GetSubCertFile() (string, error)
func (*SettingService) GetSubDomain ¶
func (s *SettingService) GetSubDomain() (string, error)
func (*SettingService) GetSubEnable ¶
func (s *SettingService) GetSubEnable() (bool, error)
func (*SettingService) GetSubEncrypt ¶
func (s *SettingService) GetSubEncrypt() (bool, error)
func (*SettingService) GetSubJsonFragment ¶
func (s *SettingService) GetSubJsonFragment() (string, error)
func (*SettingService) GetSubJsonMux ¶
func (s *SettingService) GetSubJsonMux() (string, error)
func (*SettingService) GetSubJsonNoises ¶
func (s *SettingService) GetSubJsonNoises() (string, error)
func (*SettingService) GetSubJsonPath ¶
func (s *SettingService) GetSubJsonPath() (string, error)
func (*SettingService) GetSubJsonRules ¶
func (s *SettingService) GetSubJsonRules() (string, error)
func (*SettingService) GetSubJsonURI ¶
func (s *SettingService) GetSubJsonURI() (string, error)
func (*SettingService) GetSubKeyFile ¶
func (s *SettingService) GetSubKeyFile() (string, error)
func (*SettingService) GetSubListen ¶
func (s *SettingService) GetSubListen() (string, error)
func (*SettingService) GetSubPath ¶
func (s *SettingService) GetSubPath() (string, error)
func (*SettingService) GetSubPort ¶
func (s *SettingService) GetSubPort() (int, error)
func (*SettingService) GetSubShowInfo ¶
func (s *SettingService) GetSubShowInfo() (bool, error)
func (*SettingService) GetSubURI ¶
func (s *SettingService) GetSubURI() (string, error)
func (*SettingService) GetSubUpdates ¶
func (s *SettingService) GetSubUpdates() (string, error)
func (*SettingService) GetTgBotBackup ¶
func (s *SettingService) GetTgBotBackup() (bool, error)
func (*SettingService) GetTgBotChatId ¶
func (s *SettingService) GetTgBotChatId() (string, error)
func (*SettingService) GetTgBotLoginNotify ¶
func (s *SettingService) GetTgBotLoginNotify() (bool, error)
func (*SettingService) GetTgBotToken ¶
func (s *SettingService) GetTgBotToken() (string, error)
func (*SettingService) GetTgCpu ¶
func (s *SettingService) GetTgCpu() (int, error)
func (*SettingService) GetTgLang ¶
func (s *SettingService) GetTgLang() (string, error)
func (*SettingService) GetTgbotRuntime ¶
func (s *SettingService) GetTgbotRuntime() (string, error)
func (*SettingService) GetTgbotenabled ¶
func (s *SettingService) GetTgbotenabled() (bool, error)
func (*SettingService) GetTimeLocation ¶
func (s *SettingService) GetTimeLocation() (*time.Location, error)
func (*SettingService) GetTrafficDiff ¶
func (s *SettingService) GetTrafficDiff() (int, error)
func (*SettingService) GetWarp ¶
func (s *SettingService) GetWarp() (string, error)
func (*SettingService) GetWebDomain ¶
func (s *SettingService) GetWebDomain() (string, error)
func (*SettingService) GetXrayConfigTemplate ¶
func (s *SettingService) GetXrayConfigTemplate() (string, error)
func (*SettingService) ResetSettings ¶
func (s *SettingService) ResetSettings() error
func (*SettingService) SetBasePath ¶
func (s *SettingService) SetBasePath(basePath string) error
func (*SettingService) SetCertFile ¶
func (s *SettingService) SetCertFile(webCertFile string) error
func (*SettingService) SetKeyFile ¶
func (s *SettingService) SetKeyFile(webKeyFile string) error
func (*SettingService) SetPort ¶
func (s *SettingService) SetPort(port int) error
func (*SettingService) SetTgBotChatId ¶
func (s *SettingService) SetTgBotChatId(chatIds string) error
func (*SettingService) SetTgBotToken ¶
func (s *SettingService) SetTgBotToken(token string) error
func (*SettingService) SetTgbotRuntime ¶
func (s *SettingService) SetTgbotRuntime(time string) error
func (*SettingService) SetTgbotenabled ¶
func (s *SettingService) SetTgbotenabled(value bool) error
func (*SettingService) SetWarp ¶
func (s *SettingService) SetWarp(data string) error
func (*SettingService) UpdateAllSetting ¶
func (s *SettingService) UpdateAllSetting(allSetting *entity.AllSetting) error
type Status ¶
type Status struct {
T time.Time `json:"-"`
Cpu float64 `json:"cpu"`
CpuCount int `json:"cpuCount"`
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 ProcessState `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"`
AppStats struct {
Threads uint32 `json:"threads"`
Mem uint64 `json:"mem"`
Uptime uint64 `json:"uptime"`
} `json:"appStats"`
HostInfo struct {
HostName string `json:"hostname"`
Ipv4 string `json:"ipv4"`
Ipv6 string `json:"ipv6"`
} `json:"hostInfo"`
}
type Tgbot ¶
type Tgbot struct {
// contains filtered or unexported fields
}
func (*Tgbot) SendBackupToAdmins ¶
func (t *Tgbot) SendBackupToAdmins()
func (*Tgbot) SendMsgToTgbot ¶
func (t *Tgbot) SendMsgToTgbot(tgid int64, msg string, replyMarkup ...tgbotapi.InlineKeyboardMarkup)
func (*Tgbot) SendMsgToTgbotAdmins ¶
func (*Tgbot) SendReport ¶
func (t *Tgbot) SendReport()
func (*Tgbot) SetHostname ¶
func (t *Tgbot) SetHostname()
func (*Tgbot) UserLoginNotify ¶
func (t *Tgbot) UserLoginNotify(username string, ip string, time string, status LoginStatus)
type UserService ¶
type UserService struct{}
func (*UserService) CheckUser ¶
func (s *UserService) CheckUser(username string, password string) *model.User
func (*UserService) GetFirstUser ¶
func (s *UserService) GetFirstUser() (*model.User, error)
func (*UserService) UpdateFirstUser ¶
func (s *UserService) UpdateFirstUser(username string, password string) error
func (*UserService) UpdateUser ¶
func (s *UserService) UpdateUser(id int, username string, password string) error
type WarpService ¶
type WarpService struct {
SettingService
}
func (*WarpService) DelWarpData ¶
func (s *WarpService) DelWarpData() error
func (*WarpService) GetWarpConfig ¶
func (s *WarpService) GetWarpConfig() (string, error)
func (*WarpService) GetWarpData ¶
func (s *WarpService) GetWarpData() (string, error)
func (*WarpService) RegWarp ¶
func (s *WarpService) RegWarp(secretKey string, publicKey string) (string, error)
func (*WarpService) SetWarpLicense ¶
func (s *WarpService) SetWarpLicense(license string) (string, error)
type XrayService ¶
type XrayService struct {
// contains filtered or unexported fields
}
func (*XrayService) GetXrayConfig ¶
func (s *XrayService) GetXrayConfig() (*xray.Config, error)
func (*XrayService) GetXrayErr ¶
func (s *XrayService) GetXrayErr() error
func (*XrayService) GetXrayResult ¶
func (s *XrayService) GetXrayResult() string
func (*XrayService) GetXrayTraffic ¶
func (s *XrayService) GetXrayTraffic() ([]*xray.Traffic, []*xray.ClientTraffic, error)
func (*XrayService) GetXrayVersion ¶
func (s *XrayService) GetXrayVersion() string
func (*XrayService) IsNeedRestartAndSetFalse ¶
func (s *XrayService) IsNeedRestartAndSetFalse() bool
func (*XrayService) IsXrayRunning ¶
func (s *XrayService) IsXrayRunning() bool
func (*XrayService) RestartXray ¶
func (s *XrayService) RestartXray(isForce bool) error
func (*XrayService) SetToNeedRestart ¶
func (s *XrayService) SetToNeedRestart()
func (*XrayService) StopXray ¶
func (s *XrayService) StopXray() error
type XraySettingService ¶
type XraySettingService struct {
SettingService
}
func (*XraySettingService) CheckXrayConfig ¶
func (s *XraySettingService) CheckXrayConfig(XrayTemplateConfig string) error
func (*XraySettingService) SaveXraySetting ¶
func (s *XraySettingService) SaveXraySetting(newXraySettings string) error
Click to show internal directories.
Click to hide internal directories.