loginattempt

package
v0.0.0-testrgm4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginAttempt

type LoginAttempt struct {
	Id        int64
	Username  string
	IpAddress string
	Created   int64
}

type Service

type Service interface {
	// Add adds a new login attempt record for provided username
	Add(ctx context.Context, username, IPAddress string) error
	// Validate checks if username has to many login attempts inside a window.
	// Will return true if provided username do not have too many attempts.
	Validate(ctx context.Context, username string) (bool, error)
	// Reset resets all login attempts attached to username
	Reset(ctx context.Context, username string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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