security

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FloodChain

type FloodChain struct {
	NextChain Security
}

func (*FloodChain) Next

func (f *FloodChain) Next(r Request)

Check if the user is flooding commands

type Request

type Request struct {
	Bot      *tgbotapi.BotAPI
	Update   tgbotapi.Update
	Database expiraBot.Database
}

type Security

type Security interface {
	Next(r Request)
}

type SecurityChain

type SecurityChain struct {
	Request   Request
	NextChain Security
}

func (*SecurityChain) Execute

func (s *SecurityChain) Execute()

Just call the Next method of the securityChain

func (*SecurityChain) Next

func (s *SecurityChain) Next(r Request)

Check if the user is blocked If is not blocked continue, otherwise just finish the request

Jump to

Keyboard shortcuts

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