Documentation ¶
Index ¶
- Constants
- Variables
- func BatchClearIP(db *gorm.DB, ip []string) error
- func BlockIP(db *gorm.DB, ip string, reason uint8) error
- func CheckIP(db *gorm.DB, ip string) error
- func ClearIP(db *gorm.DB, ip string) error
- func IsServiceSentinelNeeded(t uint64) bool
- type AlertRule
- func (r *AlertRule) AfterFind(tx *gorm.DB) error
- func (r *AlertRule) BeforeSave(tx *gorm.DB) error
- func (r *AlertRule) Check(points [][]bool) (maxDuration int, passed bool)
- func (r *AlertRule) Enabled() bool
- func (r *AlertRule) Snapshot(cycleTransferStats *CycleTransferStats, server *Server, db *gorm.DB) []bool
- type AlertRuleForm
- type Common
- type CommonResponse
- type Config
- type CreateFMResponse
- type CreateTerminalResponse
- type Cron
- type CronForm
- type CtxKeyConnectingIP
- type CtxKeyRealIP
- type CycleTransferStats
- type DDNSForm
- type DDNSProfile
- type ForceUpdateResponse
- type FrontendTemplate
- type GeoIP
- type Host
- type HostState
- type IP
- type LoginRequest
- type LoginResponse
- type NAT
- type NATForm
- type NResult
- type Notification
- type NotificationForm
- type NotificationGroup
- type NotificationGroupForm
- type NotificationGroupNotification
- type NotificationGroupResponseItem
- type NotificationServerBundle
- type Profile
- type ProfileForm
- type Response
- type Rule
- type SensorTemperature
- type Server
- type ServerForm
- type ServerGroup
- type ServerGroupForm
- type ServerGroupResponseItem
- type ServerGroupServer
- type Service
- type ServiceForm
- type ServiceHistory
- type ServiceInfos
- type ServiceResponse
- type ServiceResponseItem
- type SettingForm
- type SettingResponse
- type StreamServer
- type StreamServerData
- type TaskFM
- type TaskNAT
- type TerminalForm
- type TerminalTask
- type Transfer
- type User
- type UserForm
- type UserGroup
- type UserGroupUser
- type WAF
- type WAFApiMock
Constants ¶
View Source
const ( ModeAlwaysTrigger = 0 ModeOnetimeTrigger = 1 )
View Source
const ( CtxKeyAuthorizedUser = "ckau" CtxKeyRealIPStr = "ckri" )
View Source
const ( ConfigUsePeerIP = "NZ::Use-Peer-IP" ConfigCoverAll = iota ConfigCoverIgnoreAll )
View Source
const ( CronCoverIgnoreAll = iota CronCoverAll CronCoverAlertTrigger CronTypeCronTask = 0 CronTypeTriggerTask = 1 )
View Source
const ( ProviderDummy = "dummy" ProviderWebHook = "webhook" ProviderCloudflare = "cloudflare" ProviderTencentCloud = "tencentcloud" )
View Source
const ( NotificationRequestTypeJSON NotificationRequestTypeForm )
View Source
const ( NotificationRequestMethodGET NotificationRequestMethodPOST )
View Source
const ( RuleCoverAll = iota RuleCoverIgnoreAll )
View Source
const ( TaskTypeHTTPGet TaskTypeICMPPing TaskTypeTCPPing TaskTypeCommand TaskTypeTerminal TaskTypeUpgrade TaskTypeKeepalive TaskTypeTerminalGRPC TaskTypeNAT TaskTypeReportHostInfoDeprecated TaskTypeFM )
View Source
const ( ServiceCoverAll = iota ServiceCoverIgnoreAll )
View Source
const ( WAFBlockReasonTypeLoginFail uint8 WAFBlockReasonTypeBruteForceToken WAFBlockReasonTypeAgentAuthFail )
View Source
const (
)
View Source
const (
MTReportHostState
)
Variables ¶
View Source
var ProviderList = []string{ ProviderDummy, ProviderWebHook, ProviderCloudflare, ProviderTencentCloud, }
Functions ¶
func IsServiceSentinelNeeded ¶
IsServiceSentinelNeeded 判断该任务类型是否需要进行服务监控 需要则返回true
Types ¶
type AlertRule ¶
type AlertRule struct { Common Name string `json:"name"` RulesRaw string `json:"-"` Enable *bool `json:"enable,omitempty"` TriggerMode uint8 `gorm:"default:0" json:"trigger_mode"` // 触发模式: 0-始终触发(默认) 1-单次触发 NotificationGroupID uint64 `json:"notification_group_id"` // 该报警规则所在的通知组 FailTriggerTasksRaw string `gorm:"default:'[]'" json:"-"` RecoverTriggerTasksRaw string `gorm:"default:'[]'" json:"-"` Rules []*Rule `gorm:"-" json:"rules"` FailTriggerTasks []uint64 `gorm:"-" json:"fail_trigger_tasks"` // 失败时执行的触发任务id RecoverTriggerTasks []uint64 `gorm:"-" json:"recover_trigger_tasks"` // 恢复时执行的触发任务id }
type AlertRuleForm ¶
type AlertRuleForm struct { Name string `json:"name" minLength:"1"` Rules []*Rule `json:"rules"` FailTriggerTasks []uint64 `json:"fail_trigger_tasks"` // 失败时触发的任务id RecoverTriggerTasks []uint64 `json:"recover_trigger_tasks"` // 恢复时触发的任务id NotificationGroupID uint64 `json:"notification_group_id"` TriggerMode uint8 `json:"trigger_mode" default:"0"` Enable bool `json:"enable" validate:"optional"` }
type CommonResponse ¶
type Config ¶
type Config struct { Debug bool `mapstructure:"debug" json:"debug,omitempty"` // debug模式开关 RealIPHeader string `mapstructure:"real_ip_header" json:"real_ip_header,omitempty"` // 真实IP Language string `mapstructure:"language" json:"language"` // 系统语言,默认 zh_CN SiteName string `mapstructure:"site_name" json:"site_name"` UserTemplate string `mapstructure:"user_template" json:"user_template,omitempty"` AdminTemplate string `mapstructure:"admin_template" json:"admin_template,omitempty"` JWTSecretKey string `mapstructure:"jwt_secret_key" json:"jwt_secret_key,omitempty"` AgentSecretKey string `mapstructure:"agent_secret_key" json:"agent_secret_key,omitempty"` ListenPort uint `mapstructure:"listen_port" json:"listen_port,omitempty"` ListenHost string `mapstructure:"listen_host" json:"listen_host,omitempty"` InstallHost string `mapstructure:"install_host" json:"install_host,omitempty"` TLS bool `mapstructure:"tls" json:"tls,omitempty"` Location string `mapstructure:"location" json:"location,omitempty"` // 时区,默认为 Asia/Shanghai EnablePlainIPInNotification bool `mapstructure:"enable_plain_ip_in_notification" json:"enable_plain_ip_in_notification,omitempty"` // 通知信息IP不打码 // IP变更提醒 EnableIPChangeNotification bool `mapstructure:"enable_ip_change_notification" json:"enable_ip_change_notification,omitempty"` IPChangeNotificationGroupID uint64 `mapstructure:"ip_change_notification_group_id" json:"ip_change_notification_group_id"` Cover uint8 `mapstructure:"cover" json:"cover"` // 覆盖范围(0:提醒未被 IgnoredIPNotification 包含的所有服务器; 1:仅提醒被 IgnoredIPNotification 包含的服务器;) IgnoredIPNotification string `mapstructure:"ignored_ip_notification" json:"ignored_ip_notification,omitempty"` // 特定服务器IP(多个服务器用逗号分隔) IgnoredIPNotificationServerIDs map[uint64]bool `mapstructure:"ignored_ip_notification_server_ids" json:"ignored_ip_notification_server_ids,omitempty"` // [ServerID] -> bool(值为true代表当前ServerID在特定服务器列表内) AvgPingCount int `mapstructure:"avg_ping_count" json:"avg_ping_count,omitempty"` DNSServers string `mapstructure:"dns_servers" json:"dns_servers,omitempty"` CustomCode string `mapstructure:"custom_code" json:"custom_code,omitempty"` CustomCodeDashboard string `mapstructure:"custom_code_dashboard" json:"custom_code_dashboard,omitempty"` // contains filtered or unexported fields }
type CreateFMResponse ¶
type CreateFMResponse struct {
SessionID string `json:"session_id,omitempty"`
}
type CreateTerminalResponse ¶
type Cron ¶
type Cron struct { Common Name string `json:"name"` TaskType uint8 `gorm:"default:0" json:"task_type"` // 0:计划任务 1:触发任务 Scheduler string `json:"scheduler"` // 分钟 小时 天 月 星期 Command string `json:"command,omitempty"` Servers []uint64 `gorm:"-" json:"servers"` PushSuccessful bool `json:"push_successful,omitempty"` // 推送成功的通知 NotificationGroupID uint64 `json:"notification_group_id"` // 指定通知方式的分组 LastExecutedAt time.Time `json:"last_executed_at,omitempty"` // 最后一次执行时间 LastResult bool `json:"last_result,omitempty"` // 最后一次执行结果 Cover uint8 `json:"cover"` // 计划任务覆盖范围 (0:仅覆盖特定服务器 1:仅忽略特定服务器 2:由触发该计划任务的服务器执行) CronJobID cron.EntryID `gorm:"-" json:"cron_job_id,omitempty"` ServersRaw string `json:"-"` }
type CronForm ¶
type CronForm struct { TaskType uint8 `json:"task_type,omitempty" default:"0"` // 0:计划任务 1:触发任务 Name string `json:"name,omitempty" minLength:"1"` Scheduler string `json:"scheduler,omitempty"` Command string `json:"command,omitempty" validate:"optional"` Servers []uint64 `json:"servers,omitempty"` Cover uint8 `json:"cover,omitempty" default:"0"` PushSuccessful bool `json:"push_successful,omitempty" validate:"optional"` NotificationGroupID uint64 `json:"notification_group_id,omitempty"` }
type CtxKeyConnectingIP ¶ added in v1.2.7
type CtxKeyConnectingIP struct{}
type CtxKeyRealIP ¶
type CtxKeyRealIP struct{}
type CycleTransferStats ¶
type CycleTransferStats struct { Name string `json:"name"` From time.Time `json:"from"` To time.Time `json:"to"` Max uint64 `json:"max"` Min uint64 `json:"min"` ServerName map[uint64]string `json:"server_name,omitempty"` Transfer map[uint64]uint64 `json:"transfer,omitempty"` NextUpdate map[uint64]time.Time `json:"next_update,omitempty"` }
type DDNSForm ¶
type DDNSForm struct { MaxRetries uint64 `json:"max_retries,omitempty" default:"3"` EnableIPv4 bool `json:"enable_ipv4,omitempty" validate:"optional"` EnableIPv6 bool `json:"enable_ipv6,omitempty" validate:"optional"` Name string `json:"name,omitempty" minLength:"1"` Provider string `json:"provider,omitempty"` Domains []string `json:"domains,omitempty"` AccessID string `json:"access_id,omitempty" validate:"optional"` AccessSecret string `json:"access_secret,omitempty" validate:"optional"` WebhookURL string `json:"webhook_url,omitempty" validate:"optional"` WebhookMethod uint8 `json:"webhook_method,omitempty" validate:"optional" default:"1"` WebhookRequestType uint8 `json:"webhook_request_type,omitempty" validate:"optional" default:"1"` WebhookRequestBody string `json:"webhook_request_body,omitempty" validate:"optional"` WebhookHeaders string `json:"webhook_headers,omitempty" validate:"optional"` }
type DDNSProfile ¶
type DDNSProfile struct { Common EnableIPv4 *bool `json:"enable_ipv4,omitempty"` EnableIPv6 *bool `json:"enable_ipv6,omitempty"` MaxRetries uint64 `json:"max_retries"` Name string `json:"name"` Provider string `json:"provider"` AccessID string `json:"access_id,omitempty"` AccessSecret string `json:"access_secret,omitempty"` WebhookURL string `json:"webhook_url,omitempty"` WebhookMethod uint8 `json:"webhook_method,omitempty"` WebhookRequestType uint8 `json:"webhook_request_type,omitempty"` WebhookRequestBody string `json:"webhook_request_body,omitempty"` WebhookHeaders string `json:"webhook_headers,omitempty"` Domains []string `json:"domains" gorm:"-"` DomainsRaw string `json:"-"` }
func (*DDNSProfile) BeforeSave ¶
func (d *DDNSProfile) BeforeSave(tx *gorm.DB) error
func (DDNSProfile) TableName ¶
func (d DDNSProfile) TableName() string
type ForceUpdateResponse ¶
type FrontendTemplate ¶ added in v1.1.4
type FrontendTemplate struct { Path string `json:"path,omitempty"` Name string `json:"name,omitempty"` Repository string `json:"repository,omitempty"` Author string `json:"author,omitempty"` Version string `json:"version,omitempty"` IsAdmin bool `json:"is_admin,omitempty"` IsOfficial bool `json:"is_official,omitempty"` }
type GeoIP ¶
type Host ¶
type Host struct { Platform string `json:"platform,omitempty"` PlatformVersion string `json:"platform_version,omitempty"` CPU []string `json:"cpu,omitempty"` MemTotal uint64 `json:"mem_total,omitempty"` DiskTotal uint64 `json:"disk_total,omitempty"` SwapTotal uint64 `json:"swap_total,omitempty"` Arch string `json:"arch,omitempty"` Virtualization string `json:"virtualization,omitempty"` BootTime uint64 `json:"boot_time,omitempty"` Version string `json:"version,omitempty"` GPU []string `json:"gpu,omitempty"` }
type HostState ¶
type HostState struct { CPU float64 `json:"cpu,omitempty"` MemUsed uint64 `json:"mem_used,omitempty"` SwapUsed uint64 `json:"swap_used,omitempty"` DiskUsed uint64 `json:"disk_used,omitempty"` NetInTransfer uint64 `json:"net_in_transfer,omitempty"` NetOutTransfer uint64 `json:"net_out_transfer,omitempty"` NetInSpeed uint64 `json:"net_in_speed,omitempty"` NetOutSpeed uint64 `json:"net_out_speed,omitempty"` Uptime uint64 `json:"uptime,omitempty"` Load1 float64 `json:"load_1,omitempty"` Load5 float64 `json:"load_5,omitempty"` Load15 float64 `json:"load_15,omitempty"` TcpConnCount uint64 `json:"tcp_conn_count,omitempty"` UdpConnCount uint64 `json:"udp_conn_count,omitempty"` ProcessCount uint64 `json:"process_count,omitempty"` Temperatures []SensorTemperature `json:"temperatures,omitempty"` GPU []float64 `json:"gpu,omitempty"` }
type IP ¶
type LoginRequest ¶
type LoginResponse ¶
type Notification ¶
type Notification struct { Common Name string `json:"name"` URL string `json:"url"` RequestMethod uint8 `json:"request_method"` RequestType uint8 `json:"request_type"` RequestHeader string `json:"request_header" gorm:"type:longtext"` RequestBody string `json:"request_body" gorm:"type:longtext"` VerifyTLS *bool `json:"verify_tls,omitempty"` }
type NotificationForm ¶
type NotificationForm struct { Name string `json:"name,omitempty" minLength:"1"` URL string `json:"url,omitempty"` RequestMethod uint8 `json:"request_method,omitempty"` RequestType uint8 `json:"request_type,omitempty"` RequestHeader string `json:"request_header,omitempty"` RequestBody string `json:"request_body,omitempty"` VerifyTLS bool `json:"verify_tls,omitempty" validate:"optional"` SkipCheck bool `json:"skip_check,omitempty" validate:"optional"` }
type NotificationGroup ¶
type NotificationGroupForm ¶
type NotificationGroupResponseItem ¶
type NotificationGroupResponseItem struct { Group NotificationGroup `json:"group"` Notifications []uint64 `json:"notifications"` }
type NotificationServerBundle ¶
type NotificationServerBundle struct { Notification *Notification Server *Server Loc *time.Location }
func (*NotificationServerBundle) Send ¶
func (ns *NotificationServerBundle) Send(message string) error
type ProfileForm ¶
type Rule ¶
type Rule struct { // 指标类型,cpu、memory、swap、disk、net_in_speed、net_out_speed // net_all_speed、transfer_in、transfer_out、transfer_all、offline // transfer_in_cycle、transfer_out_cycle、transfer_all_cycle Type string `json:"type"` Min float64 `json:"min,omitempty" validate:"optional"` // 最小阈值 (百分比、字节 kb ÷ 1024) Max float64 `json:"max,omitempty" validate:"optional"` // 最大阈值 (百分比、字节 kb ÷ 1024) CycleStart *time.Time `json:"cycle_start,omitempty" validate:"optional"` // 流量统计的开始时间 CycleInterval uint64 `json:"cycle_interval,omitempty" validate:"optional"` // 流量统计周期 CycleUnit string `json:"cycle_unit,omitempty" enums:"hour,day,week,month,year" validate:"optional" default:"hour"` // 流量统计周期单位,默认hour,可选(hour, day, week, month, year) Duration uint64 `json:"duration,omitempty" validate:"optional"` // 持续时间 (秒) Cover uint64 `json:"cover"` // 覆盖范围 RuleCoverAll/IgnoreAll Ignore map[uint64]bool `json:"ignore,omitempty" validate:"optional"` // 覆盖范围的排除 // 只作为缓存使用,记录下次该检测的时间 NextTransferAt map[uint64]time.Time `json:"-"` LastCycleStatus map[uint64]bool `json:"-"` }
func (*Rule) GetTransferDurationEnd ¶
GetTransferDurationEnd 获取周期流量结束时间
func (*Rule) GetTransferDurationStart ¶
GetTransferDurationStart 获取周期流量的起始时间
func (*Rule) IsTransferDurationRule ¶
IsTransferDurationRule 判断该规则是否属于周期流量规则 属于则返回true
type SensorTemperature ¶
type Server ¶
type Server struct { Common Name string `json:"name"` UUID string `json:"uuid,omitempty" gorm:"unique"` Note string `json:"note,omitempty"` // 管理员可见备注 PublicNote string `json:"public_note,omitempty"` // 公开备注 DisplayIndex int `json:"display_index"` // 展示排序,越大越靠前 HideForGuest bool `json:"hide_for_guest,omitempty"` // 对游客隐藏 EnableDDNS bool `json:"enable_ddns,omitempty"` // 启用DDNS DDNSProfilesRaw string `gorm:"default:'[]';column:ddns_profiles_raw" json:"-"` DDNSProfiles []uint64 `gorm:"-" json:"ddns_profiles,omitempty" validate:"optional"` // DDNS配置 Host *Host `gorm:"-" json:"host,omitempty"` State *HostState `gorm:"-" json:"state,omitempty"` GeoIP *GeoIP `gorm:"-" json:"geoip,omitempty"` LastActive time.Time `gorm:"-" json:"last_active,omitempty"` TaskStream pb.NezhaService_RequestTaskServer `gorm:"-" json:"-"` PrevTransferInSnapshot int64 `gorm:"-" json:"-"` // 上次数据点时的入站使用量 PrevTransferOutSnapshot int64 `gorm:"-" json:"-"` // 上次数据点时的出站使用量 }
func (*Server) CopyFromRunningServer ¶
type ServerForm ¶
type ServerForm struct { Name string `json:"name,omitempty"` Note string `json:"note,omitempty" validate:"optional"` // 管理员可见备注 PublicNote string `json:"public_note,omitempty" validate:"optional"` // 公开备注 DisplayIndex int `json:"display_index,omitempty" default:"0"` // 展示排序,越大越靠前 HideForGuest bool `json:"hide_for_guest,omitempty" validate:"optional"` // 对游客隐藏 EnableDDNS bool `json:"enable_ddns,omitempty" validate:"optional"` // 启用DDNS DDNSProfiles []uint64 `gorm:"-" json:"ddns_profiles,omitempty" validate:"optional"` // DDNS配置 }
type ServerGroup ¶
type ServerGroupForm ¶
type ServerGroupResponseItem ¶
type ServerGroupResponseItem struct { Group ServerGroup `json:"group"` Servers []uint64 `json:"servers"` }
type ServerGroupServer ¶
type Service ¶
type Service struct { Common Name string `json:"name"` Type uint8 `json:"type"` Target string `json:"target"` SkipServersRaw string `json:"-"` Duration uint64 `json:"duration"` Notify bool `json:"notify,omitempty"` NotificationGroupID uint64 `json:"notification_group_id"` // 当前服务监控所属的通知组 ID Cover uint8 `json:"cover"` EnableTriggerTask bool `gorm:"default: false" json:"enable_trigger_task,omitempty"` EnableShowInService bool `gorm:"default: false" json:"enable_show_in_service,omitempty"` FailTriggerTasksRaw string `gorm:"default:'[]'" json:"-"` RecoverTriggerTasksRaw string `gorm:"default:'[]'" json:"-"` FailTriggerTasks []uint64 `gorm:"-" json:"fail_trigger_tasks"` // 失败时执行的触发任务id RecoverTriggerTasks []uint64 `gorm:"-" json:"recover_trigger_tasks"` // 恢复时执行的触发任务id MinLatency float32 `json:"min_latency"` MaxLatency float32 `json:"max_latency"` LatencyNotify bool `json:"latency_notify,omitempty"` SkipServers map[uint64]bool `gorm:"-" json:"skip_servers"` CronJobID cron.EntryID `gorm:"-" json:"-"` }
type ServiceForm ¶
type ServiceForm struct { Name string `json:"name,omitempty" minLength:"1"` Target string `json:"target,omitempty"` Type uint8 `json:"type,omitempty"` Cover uint8 `json:"cover,omitempty"` Notify bool `json:"notify,omitempty" validate:"optional"` Duration uint64 `json:"duration,omitempty"` MinLatency float32 `json:"min_latency,omitempty" default:"0.0"` MaxLatency float32 `json:"max_latency,omitempty" default:"0.0"` LatencyNotify bool `json:"latency_notify,omitempty" validate:"optional"` EnableTriggerTask bool `json:"enable_trigger_task,omitempty" validate:"optional"` EnableShowInService bool `json:"enable_show_in_service,omitempty" validate:"optional"` FailTriggerTasks []uint64 `json:"fail_trigger_tasks,omitempty"` RecoverTriggerTasks []uint64 `json:"recover_trigger_tasks,omitempty"` SkipServers map[uint64]bool `json:"skip_servers,omitempty"` NotificationGroupID uint64 `json:"notification_group_id,omitempty"` }
type ServiceHistory ¶
type ServiceHistory struct { ID uint64 `gorm:"primaryKey" json:"id,omitempty"` CreatedAt time.Time `gorm:"index;<-:create;index:idx_server_id_created_at_service_id_avg_delay" json:"created_at,omitempty"` UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at,omitempty"` ServiceID uint64 `gorm:"index:idx_server_id_created_at_service_id_avg_delay" json:"service_id,omitempty"` ServerID uint64 `gorm:"index:idx_server_id_created_at_service_id_avg_delay" json:"server_id,omitempty"` AvgDelay float32 `gorm:"index:idx_server_id_created_at_service_id_avg_delay" json:"avg_delay,omitempty"` // 平均延迟,毫秒 Up uint64 `json:"up,omitempty"` // 检查状态良好计数 Down uint64 `json:"down,omitempty"` // 检查状态异常计数 Data string `json:"data,omitempty"` }
type ServiceInfos ¶
type ServiceResponse ¶
type ServiceResponse struct { Services map[uint64]ServiceResponseItem `json:"services,omitempty"` CycleTransferStats map[uint64]CycleTransferStats `json:"cycle_transfer_stats,omitempty"` }
type ServiceResponseItem ¶
type ServiceResponseItem struct { ServiceName string `json:"service_name,omitempty"` CurrentUp uint64 `json:"current_up"` CurrentDown uint64 `json:"current_down"` TotalUp uint64 `json:"total_up"` TotalDown uint64 `json:"total_down"` Delay *[30]float32 `json:"delay,omitempty"` Up *[30]int `json:"up,omitempty"` Down *[30]int `json:"down,omitempty"` }
func (ServiceResponseItem) TotalUptime ¶
func (r ServiceResponseItem) TotalUptime() float32
type SettingForm ¶
type SettingForm struct { DNSServers string `json:"dns_servers,omitempty" validate:"optional"` IgnoredIPNotification string `json:"ignored_ip_notification,omitempty" validate:"optional"` IPChangeNotificationGroupID uint64 `json:"ip_change_notification_group_id,omitempty"` // IP变更提醒的通知组 Cover uint8 `json:"cover,omitempty"` SiteName string `json:"site_name,omitempty" minLength:"1"` Language string `json:"language,omitempty" minLength:"2"` InstallHost string `json:"install_host,omitempty" validate:"optional"` CustomCode string `json:"custom_code,omitempty" validate:"optional"` CustomCodeDashboard string `json:"custom_code_dashboard,omitempty" validate:"optional"` RealIPHeader string `json:"real_ip_header,omitempty" validate:"optional"` // 真实IP UserTemplate string `json:"user_template,omitempty" validate:"optional"` TLS bool `json:"tls,omitempty" validate:"optional"` EnableIPChangeNotification bool `json:"enable_ip_change_notification,omitempty" validate:"optional"` EnablePlainIPInNotification bool `json:"enable_plain_ip_in_notification,omitempty" validate:"optional"` }
type SettingResponse ¶ added in v1.0.19
type SettingResponse struct { Config Version string `json:"version,omitempty"` FrontendTemplates []FrontendTemplate `json:"frontend_templates,omitempty"` }
type StreamServer ¶
type StreamServer struct { ID uint64 `json:"id,omitempty"` Name string `json:"name,omitempty"` PublicNote string `json:"public_note,omitempty"` // 公开备注,只第一个数据包有值 DisplayIndex int `json:"display_index,omitempty"` // 展示排序,越大越靠前 Host *Host `json:"host,omitempty"` State *HostState `json:"state,omitempty"` CountryCode string `json:"country_code,omitempty"` LastActive time.Time `json:"last_active,omitempty"` }
type StreamServerData ¶
type StreamServerData struct { Now int64 `json:"now,omitempty"` Online uint64 `json:"online,omitempty"` Servers []StreamServer `json:"servers,omitempty"` }
type TerminalForm ¶
type TerminalTask ¶
type TerminalTask struct {
StreamID string
}
type UserGroupUser ¶
Source Files ¶
- alertrule.go
- alertrule_api.go
- api.go
- common.go
- config.go
- cron.go
- cron_api.go
- ddns.go
- ddns_api.go
- fm_api.go
- host.go
- nat.go
- nat_api.go
- notification.go
- notification_api.go
- notification_group.go
- notification_group_api.go
- notification_group_notification.go
- rule.go
- server.go
- server_api.go
- server_group.go
- server_group_api.go
- server_group_server.go
- service.go
- service_api.go
- service_history.go
- service_history_api.go
- setting_api.go
- terminal_api.go
- transfer.go
- user.go
- user_api.go
- user_group.go
- user_group_user.go
- waf.go
Click to show internal directories.
Click to hide internal directories.