Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemoryProtector ¶
type MemoryProtector struct {
// contains filtered or unexported fields
}
func (*MemoryProtector) Check ¶
func (m *MemoryProtector) Check(_ context.Context, key string) error
func (*MemoryProtector) RecordFailure ¶
func (m *MemoryProtector) RecordFailure(_ context.Context, key string)
func (*MemoryProtector) RecordSuccess ¶
func (m *MemoryProtector) RecordSuccess(_ context.Context, key string)
type Protector ¶
type Protector interface {
Check(ctx context.Context, key string) error
RecordFailure(ctx context.Context, key string)
RecordSuccess(ctx context.Context, key string)
}
Protector prevents brute-force attacks.
func NewMemoryProtector ¶
type RedisProtector ¶
type RedisProtector struct {
// contains filtered or unexported fields
}
func (*RedisProtector) Check ¶
func (r *RedisProtector) Check(ctx context.Context, key string) error
func (*RedisProtector) RecordFailure ¶
func (r *RedisProtector) RecordFailure(ctx context.Context, key string)
func (*RedisProtector) RecordSuccess ¶
func (r *RedisProtector) RecordSuccess(ctx context.Context, key string)
Click to show internal directories.
Click to hide internal directories.