Documentation ¶
Index ¶
- Variables
- type Nick
- type Plugin
- type TemporaryBan
- type TemporaryBanExport
- type TemporaryBanManager
- func (tbmgr *TemporaryBanManager) Add(ban TemporaryBan) error
- func (tbmgr *TemporaryBanManager) Export(w io.Writer) error
- func (tbmgr *TemporaryBanManager) Get(hostmask string) (TemporaryBan, bool)
- func (tbmgr *TemporaryBanManager) GetAll() []TemporaryBan
- func (tbmgr *TemporaryBanManager) Import(r io.Reader) error
- func (tbmgr *TemporaryBanManager) Remove(hostmask string) (foundBan TemporaryBan, deleted bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHostmaskAlreadyBanned = errors.New("Hostmask already banned.")
View Source
var ErrNotAChannel = errors.New("Not a channel.")
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct { OldHostmasks []string // contains filtered or unexported fields }
func (*Plugin) Ban ¶
func (p *Plugin) Ban(target string, bans ...TemporaryBan) (retval []error)
Sets multiple bans in a target channel.
Returns an error slice of the same amount of elements as bans passed in, each error corresponding to the respective ban by index.
All errors will be ErrNotAChannel if the target is not a valid channel.
func (*Plugin) Bans ¶
func (p *Plugin) Bans(target string) []TemporaryBan
type TemporaryBan ¶
type TemporaryBan struct { Nick string Hostmask string Source string Reason string BanTime time.Time ExpirationTime time.Time }
func NewTemporaryBan ¶
func (TemporaryBan) RemainingDuration ¶
func (t TemporaryBan) RemainingDuration() time.Duration
func (TemporaryBan) TargetUser ¶
func (t TemporaryBan) TargetUser() (nick, ident, host string)
func (TemporaryBan) TotalDuration ¶
func (t TemporaryBan) TotalDuration() time.Duration
func (TemporaryBan) WaitUntilExpired ¶
func (t TemporaryBan) WaitUntilExpired() <-chan time.Time
type TemporaryBanExport ¶
type TemporaryBanExport struct {
Bans []TemporaryBan
}
type TemporaryBanManager ¶
type TemporaryBanManager struct { BanExpiredFunc func(TemporaryBan) DisableExpiry bool // contains filtered or unexported fields }
func NewTemporaryBanManager ¶
func NewTemporaryBanManager() *TemporaryBanManager
func (*TemporaryBanManager) Add ¶
func (tbmgr *TemporaryBanManager) Add(ban TemporaryBan) error
func (*TemporaryBanManager) Get ¶
func (tbmgr *TemporaryBanManager) Get(hostmask string) (TemporaryBan, bool)
func (*TemporaryBanManager) GetAll ¶
func (tbmgr *TemporaryBanManager) GetAll() []TemporaryBan
func (*TemporaryBanManager) Remove ¶
func (tbmgr *TemporaryBanManager) Remove(hostmask string) (foundBan TemporaryBan, deleted bool)
Click to show internal directories.
Click to hide internal directories.