fail2ban

package
v3.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

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"`
	Type        string `json:"type" validate:"required"`
	MaxRetry    int    `json:"maxretry" validate:"required"`
	FindTime    int    `json:"findtime" validate:"required"`
	BanTime     int    `json:"bantime" validate:"required"`
	WebsiteName string `json:"website_name"`
	WebsiteMode string `json:"website_mode"`
	WebsitePath string `json:"website_path"`
}

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(t *gotext.Locale, website biz.WebsiteRepo) *App

func (*App) BanList

func (s *App) BanList(w http.ResponseWriter, r *http.Request)

BanList 获取封禁列表

func (*App) Create

func (s *App) Create(w http.ResponseWriter, r *http.Request)

Create 添加规则

func (*App) Delete

func (s *App) Delete(w http.ResponseWriter, r *http.Request)

Delete 删除规则

func (*App) GetWhiteList

func (s *App) GetWhiteList(w http.ResponseWriter, r *http.Request)

GetWhiteList 获取白名单

func (*App) List

func (s *App) List(w http.ResponseWriter, r *http.Request)

List 所有规则

func (*App) Route

func (s *App) Route(r chi.Router)

func (*App) SetWhiteList

func (s *App) SetWhiteList(w http.ResponseWriter, r *http.Request)

SetWhiteList 设置白名单

func (*App) Status added in v3.2.2

func (s *App) Status() string

func (*App) Unban

func (s *App) Unban(w http.ResponseWriter, r *http.Request)

Unban 解封

type BanList

type BanList struct {
	Name string `json:"name" validate:"required"`
}

type Delete

type Delete struct {
	Name string `json:"name" validate:"required"`
}

type Jail

type Jail struct {
	Name     string `json:"name"`
	Enabled  bool   `json:"enabled"`
	MaxRetry int    `json:"max_retry"`
	FindTime int    `json:"find_time"`
	BanTime  int    `json:"ban_time"`
}

type SetWhiteList

type SetWhiteList struct {
	IP string `json:"ip" validate:"required"`
}

type Unban

type Unban struct {
	Name string `json:"name" validate:"required"`
	IP   string `json:"ip" validate:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL