Documentation
¶
Index ¶
- type Add
- type App
- func (s *App) BanList(w http.ResponseWriter, r *http.Request)
- func (s *App) Create(w http.ResponseWriter, r *http.Request)
- func (s *App) Delete(w http.ResponseWriter, r *http.Request)
- func (s *App) GetWhiteList(w http.ResponseWriter, r *http.Request)
- func (s *App) List(w http.ResponseWriter, r *http.Request)
- func (s *App) Route(r chi.Router)
- func (s *App) SetWhiteList(w http.ResponseWriter, r *http.Request)
- func (s *App) Status(ctx context.Context) string
- func (s *App) Unban(w http.ResponseWriter, r *http.Request)
- func (s *App) Update(w http.ResponseWriter, r *http.Request)
- type Jail
- type JailName
- type SetWhiteList
- type Unban
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Add ¶
type Add struct {
Name string `json:"name" validate:"required && regex:\"^[a-zA-Z0-9_.-]+$\""`
Type string `json:"type" validate:"required && in:service,website"`
MaxRetry int `json:"maxretry" validate:"required && min:1"`
FindTime int `json:"findtime" validate:"required && min:1"`
BanTime int `json:"bantime" validate:"required && min:1"`
WebsiteName string `json:"website_name" validate:"required_if:Type,website"`
WebsiteMode string `json:"website_mode" validate:"required_if:Type,website && in:cc,path"`
WebsitePath string `json:"website_path"`
}
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) GetWhiteList ¶
func (s *App) GetWhiteList(w http.ResponseWriter, r *http.Request)
GetWhiteList 获取白名单
func (*App) SetWhiteList ¶
func (s *App) SetWhiteList(w http.ResponseWriter, r *http.Request)
SetWhiteList 设置白名单
type JailName ¶ added in v3.3.2
type JailName struct {
Name string `form:"name" json:"name" validate:"required && regex:\"^[a-zA-Z0-9_.-]+$\""`
}
type SetWhiteList ¶
type SetWhiteList struct {
IP string `json:"ip" validate:"required"`
}
type Update ¶ added in v3.3.2
type Update struct {
Name string `form:"name" json:"name" validate:"required && regex:\"^[a-zA-Z0-9_.-]+$\""`
Enabled bool `json:"enabled"`
MaxRetry int `json:"max_retry" validate:"required && min:1"`
FindTime int `json:"find_time" validate:"required && min:1"`
BanTime int `json:"ban_time" validate:"required && min:1"`
}
Update 只允许改这几项,过滤器、端口与日志路径随规则文件原样保留
Click to show internal directories.
Click to hide internal directories.