sqlite

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIKeyRepository

func NewAPIKeyRepository(db *database.DB) repository.APIKeyRepository

NewAPIKeyRepository creates a new SQLite API key repository

func NewAliasRepository

func NewAliasRepository(db *database.DB) repository.AliasRepository

NewAliasRepository creates a new SQLite alias repository

func NewDomainRepository

func NewDomainRepository(db *database.DB) repository.DomainRepository

NewDomainRepository creates a new SQLite domain repository

func NewMailboxRepository

func NewMailboxRepository(db *database.DB) repository.MailboxRepository

NewMailboxRepository creates a new SQLite mailbox repository

func NewMessageRepository

func NewMessageRepository(db *database.DB) repository.MessageRepository

NewMessageRepository creates a new SQLite message repository

func NewQueueRepository

func NewQueueRepository(db *database.DB) repository.QueueRepository

NewQueueRepository creates a new SQLite queue repository

func NewUserRepository

func NewUserRepository(db *database.DB) repository.UserRepository

NewUserRepository creates a new SQLite user repository

func NewWebhookRepository

func NewWebhookRepository(db *database.DB) repository.WebhookRepository

NewWebhookRepository creates a new SQLite webhook repository

Types

type GreylistRepository

type GreylistRepository struct {
	// contains filtered or unexported fields
}

GreylistRepository implements repository.GreylistRepository

func NewGreylistRepository

func NewGreylistRepository(db *database.DB) *GreylistRepository

NewGreylistRepository creates a new greylist repository

func (*GreylistRepository) Create

func (r *GreylistRepository) Create(ip, sender, recipient string) (*domain.GreylistTriplet, error)

Create creates a new greylist triplet

func (*GreylistRepository) DeleteOlderThan

func (r *GreylistRepository) DeleteOlderThan(age time.Duration) error

DeleteOlderThan deletes greylist entries older than the specified age

func (*GreylistRepository) Get

func (r *GreylistRepository) Get(ip, sender, recipient string) (*domain.GreylistTriplet, error)

Get retrieves a greylist triplet

func (*GreylistRepository) IncrementPass

func (r *GreylistRepository) IncrementPass(id int64) error

IncrementPass marks a greylist triplet as passed

type IPBlacklistRepository

type IPBlacklistRepository struct {
	// contains filtered or unexported fields
}

IPBlacklistRepository implements repository.IPBlacklistRepository

func NewIPBlacklistRepository

func NewIPBlacklistRepository(db *database.DB) *IPBlacklistRepository

NewIPBlacklistRepository creates a new IP blacklist repository

func (*IPBlacklistRepository) Add

func (r *IPBlacklistRepository) Add(ip, reason string, expiresAt *time.Time) error

Add adds an IP to the blacklist

func (*IPBlacklistRepository) IsBlacklisted

func (r *IPBlacklistRepository) IsBlacklisted(ip string) (bool, error)

IsBlacklisted checks if an IP is currently blacklisted

func (*IPBlacklistRepository) Remove

func (r *IPBlacklistRepository) Remove(ip string) error

Remove removes an IP from the blacklist

func (*IPBlacklistRepository) RemoveExpired

func (r *IPBlacklistRepository) RemoveExpired() error

RemoveExpired removes all expired blacklist entries

type LoginAttemptRepository

type LoginAttemptRepository struct {
	// contains filtered or unexported fields
}

LoginAttemptRepository implements repository.LoginAttemptRepository

func NewLoginAttemptRepository

func NewLoginAttemptRepository(db *database.DB) *LoginAttemptRepository

NewLoginAttemptRepository creates a new login attempt repository

func (*LoginAttemptRepository) Cleanup

func (r *LoginAttemptRepository) Cleanup(age time.Duration) error

Cleanup removes old login attempt records

func (*LoginAttemptRepository) GetRecentFailures

func (r *LoginAttemptRepository) GetRecentFailures(ip string, duration time.Duration) (int, error)

GetRecentFailures counts failed login attempts from an IP within the duration

func (*LoginAttemptRepository) GetRecentUserFailures

func (r *LoginAttemptRepository) GetRecentUserFailures(email string, duration time.Duration) (int, error)

GetRecentUserFailures counts failed login attempts for an email within the duration

func (*LoginAttemptRepository) Record

func (r *LoginAttemptRepository) Record(ip, email string, success bool) error

Record records a login attempt (success or failure)

type RateLimitRepository

type RateLimitRepository struct {
	// contains filtered or unexported fields
}

RateLimitRepository implements repository.RateLimitRepository

func NewRateLimitRepository

func NewRateLimitRepository(db *database.DB) *RateLimitRepository

NewRateLimitRepository creates a new rate limit repository

func (*RateLimitRepository) Cleanup

func (r *RateLimitRepository) Cleanup(windowDuration time.Duration) error

Cleanup removes old rate limit entries

func (*RateLimitRepository) CreateOrUpdate

func (r *RateLimitRepository) CreateOrUpdate(entry *domain.RateLimitEntry) error

CreateOrUpdate creates or updates a rate limit entry

func (*RateLimitRepository) Get

func (r *RateLimitRepository) Get(key string, limitType string) (*domain.RateLimitEntry, error)

Get retrieves a rate limit entry

Jump to

Keyboard shortcuts

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