Documentation ¶
Index ¶
- func NewCachedIpGeoQuerier(querier ipgeo.Querier, db *Database) ipgeo.Querier
- type AbuseipdbReport
- type BruteAttempt
- type BruteAttemptKind
- type Database
- func (db *Database) Create(ctx context.Context, value any) error
- func (db *Database) IncrBruteAttempt(ctx context.Context, ip string, kind BruteAttemptKind, timestamp time.Time, ...) (*BruteAttempt, error)
- func (db *Database) LastAbuseipdbReport(ctx context.Context, ip string) (*AbuseipdbReport, bool, error)
- func (db *Database) Save(ctx context.Context, value any) error
- func (db *Database) ScanBruteAttempt(ctx context.Context, updatedAfter time.Time, ...) error
- func (db *Database) TakeIpGeo(ctx context.Context, ip string) (*IpGeo, bool, error)
- type IpGeo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AbuseipdbReport ¶
type BruteAttempt ¶
type BruteAttempt struct { Id int64 Ip string `gorm:"size:39,index:ip_kind"` // max ipv6 length Kind BruteAttemptKind `gorm:"index:ip_kind"` User string `gorm:"size:255"` Password string `gorm:"size:255"` ClientVersion string `gorm:"size:255"` StartedAt time.Time StoppedAt time.Time Count int64 CreatedAt time.Time `gorm:"<-:create"` UpdatedAt time.Time `gorm:"index"` }
func (*BruteAttempt) BeforeSave ¶
func (r *BruteAttempt) BeforeSave(_ *gorm.DB) error
func (*BruteAttempt) Duration ¶
func (r *BruteAttempt) Duration() time.Duration
func (*BruteAttempt) MaskedPassword ¶
func (r *BruteAttempt) MaskedPassword() string
func (*BruteAttempt) ShortClientVersion ¶
func (r *BruteAttempt) ShortClientVersion() string
type BruteAttemptKind ¶
type BruteAttemptKind int
const ( BruteAttemptKindSsh BruteAttemptKind // ssh BruteAttemptKindHttp // http BruteAttemptKindFtp // ftp )
func (BruteAttemptKind) String ¶
func (i BruteAttemptKind) String() string
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) IncrBruteAttempt ¶
func (*Database) LastAbuseipdbReport ¶
func (*Database) ScanBruteAttempt ¶
Click to show internal directories.
Click to hide internal directories.