Versions in this module Expand all Collapse all v2 v2.8.9 Feb 16, 2026 Changes in this version + func RemoveIndex(s []any, index int) []any + func StopBot() + type CPUSample struct + Cpu float64 + T int64 + type InboundService struct + 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) ClearClientIps(clientEmail string) error + func (s *InboundService) DelClientIPs(tx *gorm.DB, email string) error + 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) DelInboundClientByEmail(inboundId int, email string) (bool, error) + func (s *InboundService) FilterAndSortClientEmails(emails []string) ([]string, []string, error) + func (s *InboundService) GetAllInbounds() ([]*model.Inbound, error) + func (s *InboundService) GetClientByEmail(clientEmail string) (*xray.ClientTraffic, *model.Client, error) + func (s *InboundService) GetClientInboundByEmail(email string) (traffic *xray.ClientTraffic, inbound *model.Inbound, err error) + func (s *InboundService) GetClientInboundByTrafficID(trafficId int) (traffic *xray.ClientTraffic, inbound *model.Inbound, err 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 int64) ([]*xray.ClientTraffic, error) + func (s *InboundService) GetClients(inbound *model.Inbound) ([]model.Client, error) + func (s *InboundService) GetClientsLastOnline() (map[string]int64, error) + func (s *InboundService) GetInbound(id int) (*model.Inbound, error) + func (s *InboundService) GetInboundClientIps(clientEmail string) (string, error) + func (s *InboundService) GetInboundTags() (string, error) + func (s *InboundService) GetInbounds(userId int) ([]*model.Inbound, error) + func (s *InboundService) GetInboundsByTrafficReset(period string) ([]*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) ResetClientExpiryTimeByEmail(clientEmail string, expiry_time int64) (bool, error) + func (s *InboundService) ResetClientIpLimitByEmail(clientEmail string, count int) (bool, error) + func (s *InboundService) ResetClientTraffic(id int, clientEmail string) (bool, error) + func (s *InboundService) ResetClientTrafficByEmail(clientEmail string) error + func (s *InboundService) ResetClientTrafficLimitByEmail(clientEmail string, totalGB int) (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) SetClientEnableByEmail(clientEmail string, enable bool) (bool, bool, error) + func (s *InboundService) SetClientTelegramUserID(trafficId int, tgId int64) (bool, error) + func (s *InboundService) ToggleClientEnableByEmail(clientEmail string) (bool, bool, error) + func (s *InboundService) UpdateClientIPs(tx *gorm.DB, oldEmail string, newEmail string) error + func (s *InboundService) UpdateClientStat(tx *gorm.DB, email string, client *model.Client) error + func (s *InboundService) UpdateClientTrafficByEmail(email string, upload int64, download int64) error + func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound, bool, error) + func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId string) (bool, error) + type LogEntry struct + DateTime time.Time + Email string + Event int + FromAddress string + Inbound string + Outbound string + ToAddress string + type LoginStatus byte + const EmptyTelegramUserID + const LoginFail + const LoginSuccess + type OutboundService struct + func (s *OutboundService) AddTraffic(traffics []*xray.Traffic, clientTraffics []*xray.ClientTraffic) (error, bool) + func (s *OutboundService) GetOutboundsTraffic() ([]*model.OutboundTraffics, error) + func (s *OutboundService) ResetOutboundTraffic(tag string) error + type PanelService struct + func (s *PanelService) RestartPanel(delay time.Duration) error + type ProcessState string + const Error + const Running + const Stop + type Release struct + TagName string + type ServerService struct + func (s *ServerService) AggregateCpuHistory(bucketSeconds int, maxPoints int) []map[string]any + func (s *ServerService) AppendCpuSample(t time.Time, v float64) + func (s *ServerService) GetConfigJson() (any, error) + func (s *ServerService) GetDb() ([]byte, error) + func (s *ServerService) GetLogs(count string, level string, syslog string) []string + func (s *ServerService) GetNewEchCert(sni string) (any, error) + func (s *ServerService) GetNewUUID() (map[string]string, error) + func (s *ServerService) GetNewVlessEnc() (any, error) + func (s *ServerService) GetNewX25519Cert() (any, error) + func (s *ServerService) GetNewmldsa65() (any, error) + func (s *ServerService) GetNewmlkem768() (any, error) + func (s *ServerService) GetStatus(lastStatus *Status) *Status + func (s *ServerService) GetXrayLogs(count string, filter string, showDirect string, showBlocked string, ...) []LogEntry + func (s *ServerService) GetXrayVersions() ([]string, error) + func (s *ServerService) ImportDB(file multipart.File) error + func (s *ServerService) IsValidGeofileName(filename string) bool + func (s *ServerService) RestartXrayService() error + func (s *ServerService) StopXrayService() error + func (s *ServerService) UpdateGeofile(fileName string) error + func (s *ServerService) UpdateXray(version string) error + type SettingService struct + func (s *SettingService) GetAllSetting() (*entity.AllSetting, error) + func (s *SettingService) GetBasePath() (string, error) + func (s *SettingService) GetCertFile() (string, error) + func (s *SettingService) GetDatepicker() (string, error) + func (s *SettingService) GetDefaultJsonConfig() (any, error) + func (s *SettingService) GetDefaultSettings(host string) (any, error) + func (s *SettingService) GetDefaultXrayConfig() (any, error) + func (s *SettingService) GetExpireDiff() (int, error) + func (s *SettingService) GetExternalTrafficInformEnable() (bool, error) + func (s *SettingService) GetExternalTrafficInformURI() (string, error) + func (s *SettingService) GetIpLimitEnable() (bool, error) + func (s *SettingService) GetKeyFile() (string, error) + func (s *SettingService) GetLdapAutoCreate() (bool, error) + func (s *SettingService) GetLdapAutoDelete() (bool, error) + func (s *SettingService) GetLdapBaseDN() (string, error) + func (s *SettingService) GetLdapBindDN() (string, error) + func (s *SettingService) GetLdapDefaultExpiryDays() (int, error) + func (s *SettingService) GetLdapDefaultLimitIP() (int, error) + func (s *SettingService) GetLdapDefaultTotalGB() (int, error) + func (s *SettingService) GetLdapEnable() (bool, error) + func (s *SettingService) GetLdapFlagField() (string, error) + func (s *SettingService) GetLdapHost() (string, error) + func (s *SettingService) GetLdapInboundTags() (string, error) + func (s *SettingService) GetLdapInvertFlag() (bool, error) + func (s *SettingService) GetLdapPassword() (string, error) + func (s *SettingService) GetLdapPort() (int, error) + func (s *SettingService) GetLdapSyncCron() (string, error) + func (s *SettingService) GetLdapTruthyValues() (string, error) + func (s *SettingService) GetLdapUseTLS() (bool, error) + func (s *SettingService) GetLdapUserAttr() (string, error) + func (s *SettingService) GetLdapUserFilter() (string, error) + func (s *SettingService) GetLdapVlessField() (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) GetSubAnnounce() (string, error) + func (s *SettingService) GetSubCertFile() (string, error) + func (s *SettingService) GetSubDomain() (string, error) + func (s *SettingService) GetSubEnable() (bool, error) + func (s *SettingService) GetSubEnableRouting() (bool, error) + func (s *SettingService) GetSubEncrypt() (bool, error) + func (s *SettingService) GetSubJsonEnable() (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) GetSubProfileUrl() (string, error) + func (s *SettingService) GetSubRoutingRules() (string, error) + func (s *SettingService) GetSubShowInfo() (bool, error) + func (s *SettingService) GetSubSupportUrl() (string, error) + func (s *SettingService) GetSubTitle() (string, error) + func (s *SettingService) GetSubURI() (string, error) + func (s *SettingService) GetSubUpdates() (string, error) + func (s *SettingService) GetTgBotAPIServer() (string, error) + func (s *SettingService) GetTgBotBackup() (bool, error) + func (s *SettingService) GetTgBotChatId() (string, error) + func (s *SettingService) GetTgBotLoginNotify() (bool, error) + func (s *SettingService) GetTgBotProxy() (string, error) + func (s *SettingService) GetTgBotToken() (string, error) + func (s *SettingService) GetTgCpu() (int, error) + func (s *SettingService) GetTgLang() (string, error) + func (s *SettingService) GetTgbotEnabled() (bool, error) + func (s *SettingService) GetTgbotRuntime() (string, error) + func (s *SettingService) GetTimeLocation() (*time.Location, error) + func (s *SettingService) GetTrafficCoefficient() (float64, error) + func (s *SettingService) GetTrafficDiff() (int, error) + func (s *SettingService) GetTwoFactorEnable() (bool, error) + func (s *SettingService) GetTwoFactorToken() (string, 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) SetExternalTrafficInformEnable(value bool) error + func (s *SettingService) SetExternalTrafficInformURI(InformURI string) error + func (s *SettingService) SetKeyFile(webKeyFile string) error + func (s *SettingService) SetListen(ip string) error + func (s *SettingService) SetPort(port int) error + func (s *SettingService) SetSubCertFile(subCertFile string) error + func (s *SettingService) SetSubKeyFile(subKeyFile string) error + func (s *SettingService) SetTgBotAPIServer(token string) error + func (s *SettingService) SetTgBotChatId(chatIds string) error + func (s *SettingService) SetTgBotProxy(token string) error + func (s *SettingService) SetTgBotToken(token string) error + func (s *SettingService) SetTgbotEnabled(value bool) error + func (s *SettingService) SetTgbotRuntime(time string) error + func (s *SettingService) SetTwoFactorEnable(value bool) error + func (s *SettingService) SetTwoFactorToken(value string) error + func (s *SettingService) SetWarp(data string) error + func (s *SettingService) UpdateAllSetting(allSetting *entity.AllSetting) error + type Status struct + AppStats struct{ ... } + Cpu float64 + CpuCores int + CpuSpeedMhz float64 + Disk struct{ ... } + Loads []float64 + LogicalPro int + Mem struct{ ... } + NetIO struct{ ... } + NetTraffic struct{ ... } + PublicIP struct{ ... } + Swap struct{ ... } + T time.Time + TcpCount int + UdpCount int + Uptime uint64 + Xray struct{ ... } + type Tgbot struct + func (t *Tgbot) BuildInboundClientDataMessage(inbound_remark string, protocol model.Protocol) (string, error) + func (t *Tgbot) BuildJSONForProtocol(protocol model.Protocol) (string, error) + func (t *Tgbot) GetHashStorage() *global.HashStorage + func (t *Tgbot) I18nBot(name string, params ...string) string + func (t *Tgbot) IsRunning() bool + func (t *Tgbot) NewBot(token string, proxyUrl string, apiServerUrl string) (*telego.Bot, error) + 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(chatId int64, msg string, replyMarkup ...telego.ReplyMarkup) + func (t *Tgbot) SendMsgToTgbotAdmins(msg string, replyMarkup ...telego.ReplyMarkup) + func (t *Tgbot) SendMsgToTgbotDeleteAfter(chatId int64, msg string, delayInSeconds int, ...) + func (t *Tgbot) SendReport() + func (t *Tgbot) SetHostname() + func (t *Tgbot) Start(i18nFS embed.FS) error + func (t *Tgbot) Stop() + func (t *Tgbot) SubmitAddClient() (bool, error) + func (t *Tgbot) UserLoginNotify(username string, password string, ip string, time string, status LoginStatus) + type UserService struct + func (s *UserService) CheckUser(username string, password string, twoFactorCode string) *model.User + func (s *UserService) GetFirstUser() (*model.User, error) + func (s *UserService) UpdateFirstUser(username string, password string) error + func (s *UserService) UpdateUser(id int, username string, password string) error + type WarpService struct + func (s *WarpService) DelWarpData() error + func (s *WarpService) GetWarpConfig() (string, error) + func (s *WarpService) GetWarpData() (string, error) + func (s *WarpService) RegWarp(secretKey string, publicKey string) (string, error) + func (s *WarpService) SetWarpLicense(license string) (string, error) + type XrayService struct + func (s *XrayService) DidXrayCrash() bool + 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 struct + func (s *XraySettingService) CheckXrayConfig(XrayTemplateConfig string) error + func (s *XraySettingService) SaveXraySetting(newXraySettings string) error