ban

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager maintains the server ban list.

func NewManager

func NewManager(db *gorm.DB, serverID uint) *Manager

NewManager creates a BanManager.

func (*Manager) IsBanned

func (m *Manager) IsBanned(addr net.Addr, certHash string) bool

IsBanned returns true if the address or certificate hash is banned.

func (*Manager) List

func (m *Manager) List() []messages.BanEntry

List returns all active bans as BanEntry messages.

func (*Manager) Reload

func (m *Manager) Reload()

Reload re-reads bans from the database. Call when bans are modified via REST or another process.

func (*Manager) Replace

func (m *Manager) Replace(bans []messages.BanEntry) error

Replace replaces the ban list with the given entries. Caller must have Ban permission.

Jump to

Keyboard shortcuts

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