toolbox

package
v1.10.24-lts Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fail2ban

type Fail2ban struct{}

func NewFail2Ban

func NewFail2Ban() (*Fail2ban, error)

func (*Fail2ban) ListBanned

func (f *Fail2ban) ListBanned() ([]string, error)

func (*Fail2ban) ListIgnore

func (f *Fail2ban) ListIgnore() ([]string, error)

func (*Fail2ban) Operate

func (f *Fail2ban) Operate(operate string) error

func (*Fail2ban) ReBanIPs

func (f *Fail2ban) ReBanIPs(ips []string) error

func (*Fail2ban) Status

func (f *Fail2ban) Status() (bool, bool, bool)

func (*Fail2ban) Version

func (f *Fail2ban) Version() string

type FirewallClient

type FirewallClient interface {
	Status() (bool, bool, bool)
	Version() (string, error)
	Operate(operate string) error
	OperateSSHD(operate, ip string) error
}

type Ftp

type Ftp struct {
	DefaultUser  string
	DefaultGroup string
}

func NewFtpClient

func NewFtpClient() (*Ftp, error)

func (*Ftp) LoadList

func (f *Ftp) LoadList() ([]FtpList, error)

func (*Ftp) LoadLogs

func (f *Ftp) LoadLogs(user, operation string) ([]FtpLog, error)

func (*Ftp) Operate

func (f *Ftp) Operate(operate string) error

func (*Ftp) Reload

func (f *Ftp) Reload() error

func (*Ftp) SetPasswd

func (f *Ftp) SetPasswd(username, passwd string) error

func (*Ftp) SetPath

func (f *Ftp) SetPath(username, path string) error

func (*Ftp) SetStatus

func (f *Ftp) SetStatus(username, status string) error

func (*Ftp) Status

func (f *Ftp) Status() (bool, bool)

func (*Ftp) UserAdd

func (f *Ftp) UserAdd(username, passwd, path string) error

func (*Ftp) UserDel

func (f *Ftp) UserDel(username string) error

type FtpClient

type FtpClient interface {
	Status() (bool, bool)
	Operate(operate string) error
	LoadList() ([]FtpList, error)
	UserAdd(username, path, passwd string) error
	UserDel(username string) error
	SetPasswd(username, passwd string) error
	Reload() error
	LoadLogs() ([]FtpLog, error)
}

type FtpList

type FtpList struct {
	User   string
	Path   string
	Status string
}

type FtpLog

type FtpLog struct {
	IP        string `json:"ip"`
	User      string `json:"user"`
	Time      string `json:"time"`
	Operation string `json:"operation"`
	Status    string `json:"status"`
	Size      string `json:"size"`
}

Jump to

Keyboard shortcuts

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