Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCwmpScheduledTask(schedPolicy string) (err error)
- func GConfig() *config.AppConfig
- func GDB() *gorm.DB
- func GetAllRadiusMetrics() map[string]int64
- func GetAllTr069Metrics() map[string]int64
- func GetH24Metrics(name string) int64
- func GetRadiusMetrics(name string) int64
- func GetSystemMetrics() map[string]int64
- func InitGlobalApplication(cfg *config.AppConfig)
- func MatchDevice(c models.NetCpe, oui, productClass, softwareVersion string) bool
- func MatchTaskTags(cpeTaskTags, configTaskTags string) bool
- func Release()
- func Trans(module, src string) string
- func UpdateCwmpConfigSessionStatus(tc *cwmp.TransferComplete) (err error)
- func UpdateCwmpPresetTaskStatus(msg cwmp.Message) (err error)
- type Application
- func (a *Application) BackupDatabase() error
- func (a *Application) Config() *config.AppConfig
- func (a *Application) CreateCwmpPresetTaskById(pid string, snlist []string) (err error)
- func (a *Application) CwmpTable() *CwmpEventTable
- func (a *Application) DB() *gorm.DB
- func (a *Application) DropAll()
- func (a *Application) GetCacrtContent() string
- func (a *Application) GetRadiusSettingsStringValue(name string) string
- func (a *Application) GetSettingsInt64Value(stype string, name string) int64
- func (a *Application) GetSettingsStringValue(stype string, name string) string
- func (a *Application) GetSystemSettingsStringValue(name string) string
- func (a *Application) GetSystemTheme() string
- func (a *Application) GetTemplateFuncMap() map[string]interface{}
- func (a *Application) GetTr069SettingsStringValue(name string) string
- func (a *Application) GetTranslateLang() string
- func (a *Application) Init(cfg *config.AppConfig)
- func (a *Application) InitDb()
- func (a *Application) InitTest()
- func (a *Application) InjectCwmpConfigVars(sn string, src string, extvars map[string]string) string
- func (a *Application) LoadTranslateDict(lang string) map[string]map[string]string
- func (a *Application) MigrateDB(track bool) (err error)
- func (a *Application) QueryTranslateTable(lang string, module, keyword string) []TransTable
- func (a *Application) RemoveTranslateItems(items []TransTable)
- func (a *Application) RenderTranslateFiles()
- func (a *Application) SchedClearExpireData()
- func (a *Application) SchedProcessMonitorTask()
- func (a *Application) SchedSystemMonitorTask()
- func (a *Application) SchedUpdateBatchCwmpStatus()
- func (a *Application) SetSystemTheme(value string)
- func (a *Application) SetTranslateLang(lang string)
- func (a *Application) TransDB() (*bolt.DB, error)
- func (a *Application) Translate(lang, module, src, defValue string) string
- func (a *Application) TranslateUpdate(lang, module, src, value string) string
- func (a *Application) UpdateCwmpCpeRundata(sn string, vmap map[string]string)
- type CwmpCpe
- func (c *CwmpCpe) ActiveCwmpSchedEventTask() (err error)
- func (c *CwmpCpe) CheckRegister(ip string, msg *cwmp.Inform)
- func (c *CwmpCpe) CreateCwmpPresetEventTask(event string, pid string) (err error)
- func (c *CwmpCpe) CreateCwmpSchedEventTask(schedKey string) (err error)
- func (c *CwmpCpe) GetCwmpPresetEventData() (data *models.CwmpEventData, err error)
- func (c *CwmpCpe) GetLatestCwmpPresetTask() (*models.CwmpPresetTask, error)
- func (c *CwmpCpe) MatchDevice(oui, productClass, softwareVersion string) bool
- func (c *CwmpCpe) MatchTaskTags(tags string) bool
- func (c *CwmpCpe) NotifyDataUpdate(force bool)
- func (c *CwmpCpe) OnInformUpdate()
- func (c *CwmpCpe) OnInformUpdateOnline()
- func (c *CwmpCpe) OnParamsUpdate(params map[string]string)
- func (c *CwmpCpe) ProcessParameterNamesResponse(msg *cwmp.GetParameterNamesResponse)
- func (c *CwmpCpe) RecvCwmpEventData(timeoutMsec int, hp bool) (data *models.CwmpEventData, err error)
- func (c *CwmpCpe) SendCwmpEventData(data models.CwmpEventData, timeoutMsec int, hp bool) error
- func (c *CwmpCpe) TaskTags() (tags []string)
- func (c *CwmpCpe) UpdateManagementAuthInfo(session string, timeout int, hp bool) error
- func (c *CwmpCpe) UpdateParameterWritable(session string, timeoutsec int, hp bool) error
- func (c *CwmpCpe) UpdateStatus(msg *cwmp.Inform)
- type CwmpEventTable
- func (c *CwmpEventTable) ClearCwmpCpe(key string)
- func (c *CwmpEventTable) ClearCwmpCpeCache(key string)
- func (c *CwmpEventTable) GetCwmpCpe(key string) *CwmpCpe
- func (c *CwmpEventTable) ListSn() []string
- func (c *CwmpEventTable) Size() int
- func (c *CwmpEventTable) UpdateCwmpCpe(key string, msg *cwmp.Inform)
- type TransTable
Constants ¶
View Source
const ( ConfigSystemTitle = "SystemTitle" ConfigSystemTheme = "SystemTheme" ConfigSystemLoginRemark = "SystemLoginRemark" ConfigSystemLoginSubtitle = "SystemLoginSubtitle" ConfigRadiusIgnorePwd = "RadiusIgnorePwd" ConfigRadiusAccountingHistoryDays = "AccountingHistoryDays" ConfigRadiusAcctInterimInterval = "AcctInterimInterval" ConfigTR069AccessAddress = "TR069AccessAddress" ConfigTR069AccessPassword = "TR069AccessPassword" ConfigCpeConnectionRequestPassword = "CpeConnectionRequestPassword" ConfigCpeAutoRegister = "CpeAutoRegister" )
View Source
const ( RadiusVendorMikrotik = "14988" RadiusVendorIkuai = "10055" RadiusVendorHuawei = "2011" RadiusVendorZte = "3902" RadiusVendorH3c = "25506" RadiusVendorRadback = "2352" RadiusVendorCisco = "9" RadiusVendorStandard = "0" )
View Source
const ( BootStrapEvent string = "bootstrap" BootEvent string = "boot" PeriodicEvent string = "periodic" ScheduledEvent string = "scheduled" )
View Source
const ( TransLateSettings = "settings" ZhCN = "zh_CN" EnUS = "en_US" )
View Source
const ( MetricsRadiusOline = "radus_online" MetricsRadiusOffline = "radus_offline" MetricsRadiusRejectNotExists = "radus_reject_not_exists" MetricsRadiusRejectDisable = "radus_reject_disabled" MetricsRadiusRejectExpire = "radus_reject_expire" MetricsRadiusRejectOther = "radus_reject_other" MetricsRadiusRejectLimit = "radus_reject_limit" MetricsRadiusRejectBindError = "radus_reject_bind_error" MetricsRadiusRejectLdapError = "radus_reject_ldap_error" MetricsRadiusRejectPasswdError = "radus_reject_passwd_error" MetricsRadiusAuthDrop = "radus_auth_drop" MetricsRadiusAcctDrop = "radus_acct_drop" MetricsRadiusAccept = "radus_accept" MetricsRadiusAccounting = "radus_accounting" )
View Source
const ( MetricsTr069MessageTotal = "tr069_message_total" MetricsTr069Inform = "tr069_inform" MetricsTr069Download = "tr069_download" )
View Source
const (
AutoRegisterPopNodeId int64 = 999999999
)
Variables ¶
View Source
var ConfigConstants = []string{ ConfigSystemTitle, ConfigSystemTheme, ConfigSystemLoginRemark, ConfigSystemLoginSubtitle, ConfigTR069AccessAddress, ConfigTR069AccessPassword, ConfigCpeConnectionRequestPassword, ConfigCpeAutoRegister, ConfigRadiusIgnorePwd, ConfigRadiusAccountingHistoryDays, ConfigRadiusAcctInterimInterval, }
Functions ¶
func CreateCwmpScheduledTask ¶
CreateCwmpScheduledTask 系统 定时任务, 由系统触发
func GetAllRadiusMetrics ¶
func GetAllTr069Metrics ¶
func GetH24Metrics ¶
func GetRadiusMetrics ¶
func GetSystemMetrics ¶
func InitGlobalApplication ¶
func MatchDevice ¶
func MatchTaskTags ¶
func UpdateCwmpConfigSessionStatus ¶
func UpdateCwmpConfigSessionStatus(tc *cwmp.TransferComplete) (err error)
UpdateCwmpConfigSessionStatus Update script task status
func UpdateCwmpPresetTaskStatus ¶
UpdateCwmpPresetTaskStatus Update cwmp preset task status
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func GApp ¶
func GApp() *Application
func NewApplication ¶
func NewApplication(appConfig *config.AppConfig) *Application
func (*Application) BackupDatabase ¶
func (a *Application) BackupDatabase() error
BackupDatabase Backup database
func (*Application) Config ¶
func (a *Application) Config() *config.AppConfig
func (*Application) CreateCwmpPresetTaskById ¶
func (a *Application) CreateCwmpPresetTaskById(pid string, snlist []string) (err error)
CreateCwmpPresetTaskById Manually trigger tasks
func (*Application) CwmpTable ¶
func (a *Application) CwmpTable() *CwmpEventTable
func (*Application) DB ¶
func (a *Application) DB() *gorm.DB
func (*Application) DropAll ¶
func (a *Application) DropAll()
func (*Application) GetCacrtContent ¶
func (a *Application) GetCacrtContent() string
func (*Application) GetRadiusSettingsStringValue ¶
func (a *Application) GetRadiusSettingsStringValue(name string) string
func (*Application) GetSettingsInt64Value ¶
func (a *Application) GetSettingsInt64Value(stype string, name string) int64
func (*Application) GetSettingsStringValue ¶
func (a *Application) GetSettingsStringValue(stype string, name string) string
GetSettingsStringValue Get settings string value
func (*Application) GetSystemSettingsStringValue ¶
func (a *Application) GetSystemSettingsStringValue(name string) string
func (*Application) GetSystemTheme ¶
func (a *Application) GetSystemTheme() string
func (*Application) GetTemplateFuncMap ¶
func (a *Application) GetTemplateFuncMap() map[string]interface{}
func (*Application) GetTr069SettingsStringValue ¶
func (a *Application) GetTr069SettingsStringValue(name string) string
GetTr069SettingsStringValue Get tr069 settings string value
func (*Application) GetTranslateLang ¶
func (a *Application) GetTranslateLang() string
func (*Application) Init ¶
func (a *Application) Init(cfg *config.AppConfig)
func (*Application) InitDb ¶
func (a *Application) InitDb()
func (*Application) InitTest ¶
func (a *Application) InitTest()
func (*Application) InjectCwmpConfigVars ¶
func (*Application) LoadTranslateDict ¶
func (a *Application) LoadTranslateDict(lang string) map[string]map[string]string
func (*Application) MigrateDB ¶
func (a *Application) MigrateDB(track bool) (err error)
func (*Application) QueryTranslateTable ¶
func (a *Application) QueryTranslateTable(lang string, module, keyword string) []TransTable
func (*Application) RemoveTranslateItems ¶
func (a *Application) RemoveTranslateItems(items []TransTable)
func (*Application) RenderTranslateFiles ¶
func (a *Application) RenderTranslateFiles()
func (*Application) SchedClearExpireData ¶
func (a *Application) SchedClearExpireData()
func (*Application) SchedProcessMonitorTask ¶
func (a *Application) SchedProcessMonitorTask()
SchedProcessMonitorTask app process monitor
func (*Application) SchedSystemMonitorTask ¶
func (a *Application) SchedSystemMonitorTask()
SchedSystemMonitorTask system monitor
func (*Application) SchedUpdateBatchCwmpStatus ¶
func (a *Application) SchedUpdateBatchCwmpStatus()
func (*Application) SetSystemTheme ¶
func (a *Application) SetSystemTheme(value string)
func (*Application) SetTranslateLang ¶
func (a *Application) SetTranslateLang(lang string)
func (*Application) Translate ¶
func (a *Application) Translate(lang, module, src, defValue string) string
func (*Application) TranslateUpdate ¶
func (a *Application) TranslateUpdate(lang, module, src, value string) string
func (*Application) UpdateCwmpCpeRundata ¶
func (a *Application) UpdateCwmpCpeRundata(sn string, vmap map[string]string)
type CwmpCpe ¶
type CwmpCpe struct { Sn string `json:"sn"` OUI string `json:"oui"` SoftwareVersion string `json:"software_version"` Manufacturer string `json:"manufacturer"` ProductClass string `json:"product_class"` LastInform *cwmp.Inform `json:"latest_message"` LastUpdate time.Time `json:"last_update"` LastDataNotify time.Time `json:"last_data_notify"` IsRegister bool `json:"is_register"` // contains filtered or unexported fields }
func GetCwmpCpe ¶
func (*CwmpCpe) ActiveCwmpSchedEventTask ¶
func (*CwmpCpe) CheckRegister ¶
CheckRegister 检查设备注册情况
func (*CwmpCpe) CreateCwmpPresetEventTask ¶
CreateCwmpPresetEventTask Create scheduled event tasks
func (*CwmpCpe) CreateCwmpSchedEventTask ¶
CreateCwmpSchedEventTask Cwmp 定时任务, 由 CPE 触发
func (*CwmpCpe) GetCwmpPresetEventData ¶
func (c *CwmpCpe) GetCwmpPresetEventData() (data *models.CwmpEventData, err error)
GetCwmpPresetEventData 获取一个 Cwmp 预设任务执行
func (*CwmpCpe) GetLatestCwmpPresetTask ¶
func (c *CwmpCpe) GetLatestCwmpPresetTask() (*models.CwmpPresetTask, error)
func (*CwmpCpe) MatchDevice ¶
func (*CwmpCpe) MatchTaskTags ¶
func (*CwmpCpe) NotifyDataUpdate ¶
func (*CwmpCpe) OnInformUpdate ¶
func (c *CwmpCpe) OnInformUpdate()
func (*CwmpCpe) OnInformUpdateOnline ¶
func (c *CwmpCpe) OnInformUpdateOnline()
func (*CwmpCpe) OnParamsUpdate ¶
func (*CwmpCpe) ProcessParameterNamesResponse ¶
func (c *CwmpCpe) ProcessParameterNamesResponse(msg *cwmp.GetParameterNamesResponse)
func (*CwmpCpe) RecvCwmpEventData ¶
func (c *CwmpCpe) RecvCwmpEventData(timeoutMsec int, hp bool) (data *models.CwmpEventData, err error)
RecvCwmpEventData 接收一个 Cwmp 事件
func (*CwmpCpe) SendCwmpEventData ¶
SendCwmpEventData 发送一个 Cwmp 事件,
func (*CwmpCpe) UpdateManagementAuthInfo ¶
func (*CwmpCpe) UpdateParameterWritable ¶
UpdateParameterWritable 更新参数权限, 每次更新部分属性
func (*CwmpCpe) UpdateStatus ¶
type CwmpEventTable ¶
type CwmpEventTable struct {
// contains filtered or unexported fields
}
func NewCwmpEventTable ¶
func NewCwmpEventTable() *CwmpEventTable
func (*CwmpEventTable) ClearCwmpCpe ¶
func (c *CwmpEventTable) ClearCwmpCpe(key string)
func (*CwmpEventTable) ClearCwmpCpeCache ¶
func (c *CwmpEventTable) ClearCwmpCpeCache(key string)
func (*CwmpEventTable) GetCwmpCpe ¶
func (c *CwmpEventTable) GetCwmpCpe(key string) *CwmpCpe
func (*CwmpEventTable) ListSn ¶
func (c *CwmpEventTable) ListSn() []string
func (*CwmpEventTable) Size ¶
func (c *CwmpEventTable) Size() int
func (*CwmpEventTable) UpdateCwmpCpe ¶
func (c *CwmpEventTable) UpdateCwmpCpe(key string, msg *cwmp.Inform)
Click to show internal directories.
Click to hide internal directories.