Documentation
¶
Overview ¶
Package purge implements automatic purging of inactive XMPP user accounts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Enabled activates the auto-purge service.
Enabled bool `fig:"enabled"`
// InactiveDays is the number of days without login after which a user is purged.
// Defaults to 90 if not set.
InactiveDays int `fig:"inactive_days" default:"90"`
// RunInterval is how often the purge check runs (e.g. "24h").
// Defaults to 24h if not set.
RunInterval time.Duration `fig:"run_interval" default:"24h"`
// BatchSize limits the number of users deleted per run to avoid DB spikes.
// Defaults to 100.
BatchSize int `fig:"batch_size" default:"100"`
// ExcludeUsers lists usernames that must never be auto-purged (e.g. admin accounts).
ExcludeUsers []string `fig:"exclude_users"`
}
Config holds configuration for the auto-purge service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service periodically scans for users that have been inactive for longer than the configured threshold and deletes them, firing the hook.UserDeleted hook so that all modules (MAM, roster, vCard, …) clean up their data as well.
func New ¶
func New(cfg Config, rep repository.Repository, hosts *host.Hosts, hk *hook.Hooks, logger kitlog.Logger) *Service
New returns a new purge Service.
Click to show internal directories.
Click to hide internal directories.