Versions in this module Expand all Collapse all v0 v0.0.3 Nov 12, 2026 v0.0.2 Nov 11, 2026 Changes in this version type BodyStore + func (s *BodyStore) DeleteScaleReadings(ctx context.Context, userID int64, ids []int64) (int, error) + func (s *BodyStore) ScaleReadingsForReconcile(ctx context.Context, userID int64, f store.ListFilter, source string, ...) ([]models.ScaleReading, error) v0.0.1 Nov 10, 2026 Changes in this version + const DriverPostgres + const DriverSQLite + const KeySize + const ProvisionAppRole + const ProvisionBodyRole + const ProvisionBodySchema + const ProvisionDatabase + func HasEncryptedBodyValues(ctx context.Context, driver, dsn string) (bool, error) + func HasEncryptedValues(ctx context.Context, driver, dsn string) (bool, error) + func ParseKey(text string) ([]byte, error) + func Provision(ctx context.Context, o ProvisionOptions) error + func SequentialUserIDsForTests() + func SetSequentialUserIDsForTests(on bool) + type BodyRekeyStats struct + Changed int + Current int + type BodyStore struct + func OpenBody(ctx context.Context, driver, dsn string, opts ...Option) (*BodyStore, error) + func (b *BodyStore) Close() error + func (b *BodyStore) HasEncryptedValues(ctx context.Context) (bool, error) + func (b *BodyStore) HasPending(ctx context.Context) (bool, error) + func (b *BodyStore) MaxConns() int + func (b *BodyStore) Migrate(ctx context.Context) ([]*goose.MigrationResult, error) + func (b *BodyStore) Ping(ctx context.Context) error + func (b *BodyStore) Rekey(ctx context.Context, dryRun bool) (BodyRekeyStats, error) + func (b *BodyStore) SchemaVersion(ctx context.Context) (int64, error) + func (s *BodyStore) BodyStats(ctx context.Context) (store.BodyStats, error) + func (s *BodyStore) BodyUserIDs(ctx context.Context) ([]int64, error) + func (s *BodyStore) BodyVersion(ctx context.Context, userID int64) (int64, error) + func (s *BodyStore) CreateDexaScan(ctx context.Context, d *models.DexaScan) error + func (s *BodyStore) DeleteDexaScan(ctx context.Context, userID, id int64) error + func (s *BodyStore) DeleteScaleReading(ctx context.Context, userID, id int64) error + func (s *BodyStore) DeleteUserBodyData(ctx context.Context, userID int64) error + func (s *BodyStore) ListDexaScans(ctx context.Context, userID int64) ([]models.DexaScan, error) + func (s *BodyStore) ListDexaScansPage(ctx context.Context, userID int64, f store.ListFilter) ([]models.DexaScan, *store.Cursor, error) + func (s *BodyStore) ListScaleReadings(ctx context.Context, userID int64) ([]models.ScaleReading, error) + func (s *BodyStore) ListScaleReadingsPage(ctx context.Context, userID int64, f store.ListFilter) ([]models.ScaleReading, *store.Cursor, error) + func (s *BodyStore) UpsertScaleReadings(ctx context.Context, userID int64, rs []models.ScaleReading) (int, error) + type Cipher struct + func NewCipher(key []byte, previous ...[]byte) (*Cipher, error) + type CopyStats struct + AccessTokens int + AuditEvents int + DexaScans int + Identities int + Integrations int + Providers int + ScaleReads int + Settings int + Users int + func Copy(ctx context.Context, src, dst *Store) (CopyStats, error) + type Option func(*openConfig) + func RequireMigrated() Option + func WithCipher(c *Cipher) Option + func WithoutBody() Option + func WithoutMigrate() Option + type ProvisionOptions struct + AdminDSN string + AppPassword string + BodyPassword string + type RekeyStats struct + Body int + Current int + Emails int + Integrations int + Jobs int + Lookups int + Providers int + Settings int + TOTP int + func (r RekeyStats) Changed() int + type Store struct + func Open(ctx context.Context, driver, dsn string, opts ...Option) (*Store, error) + func (s *Store) AddAuditEvent(ctx context.Context, e *models.AuditEvent) error + func (s *Store) AddPasskey(ctx context.Context, p models.Passkey) error + func (s *Store) CancelJob(ctx context.Context, publicID string, userID int64, at time.Time) (models.Job, error) + func (s *Store) CancelJobs(ctx context.Context, userID int64, kinds []string, at time.Time) error + func (s *Store) ClearFailures(ctx context.Context, key string) error + func (s *Store) Close() error + func (s *Store) CompleteJob(ctx context.Context, publicID, tokenHash string, c models.Completion, ...) (models.Job, error) + func (s *Store) CompletePasswordReset(ctx context.Context, tokenHash, passwordHash string) (int64, error) + func (s *Store) ConfirmTOTP(ctx context.Context, userID, step int64) error + func (s *Store) CountFailures(ctx context.Context, key string, since time.Time) (int, error) + func (s *Store) CountRecoveryCodes(ctx context.Context, userID int64) (int, error) + func (s *Store) CreateAccessToken(ctx context.Context, t *models.AccessToken) error + func (s *Store) CreatePasswordReset(ctx context.Context, tokenHash string, userID int64, createdBy *int64, ...) error + func (s *Store) CreateSession(ctx context.Context, tokenHash string, userID int64, method string, ...) error + func (s *Store) CreateUser(ctx context.Context, name string) (models.User, error) + func (s *Store) CreateUserWithIdentity(ctx context.Context, name, email string, id models.Identity) (models.User, error) + func (s *Store) DeleteAccessToken(ctx context.Context, userID, id int64) error + func (s *Store) DeleteAuthProvider(ctx context.Context, slug string) error + func (s *Store) DeleteIdentity(ctx context.Context, userID int64, provider string) error + func (s *Store) DeleteIntegration(ctx context.Context, userID int64, provider string) error + func (s *Store) DeleteJobSchedule(ctx context.Context, userID int64, kind string) error + func (s *Store) DeletePasskey(ctx context.Context, userID int64, credentialID string) error + func (s *Store) DeletePasswordResets(ctx context.Context, userID int64) error + func (s *Store) DeleteSession(ctx context.Context, tokenHash string) error + func (s *Store) DeleteSetting(ctx context.Context, name string) error + func (s *Store) DeleteTOTP(ctx context.Context, userID int64) error + func (s *Store) DeleteUser(ctx context.Context, userID int64) error + func (s *Store) DeleteUserAccessTokens(ctx context.Context, userID int64) error + func (s *Store) DeleteUserSessions(ctx context.Context, userID int64) error + func (s *Store) EnqueueJob(ctx context.Context, n models.NewJob) (models.Job, bool, error) + func (s *Store) EnsurePasskeyHandle(ctx context.Context, userID int64) (string, error) + func (s *Store) ExecForTests(ctx context.Context, query string, args ...any) error + func (s *Store) ExpireQueuedJobs(ctx context.Context, at time.Time) (int64, error) + func (s *Store) GetAuthProvider(ctx context.Context, slug string) (models.AuthProvider, error) + func (s *Store) GetIdentity(ctx context.Context, provider, subject string) (models.Identity, error) + func (s *Store) GetIntegration(ctx context.Context, userID int64, provider string) ([]byte, error) + func (s *Store) GetJob(ctx context.Context, publicID string) (models.Job, error) + func (s *Store) GetJobSchedule(ctx context.Context, userID int64, kind string) (models.JobSchedule, error) + func (s *Store) GetSession(ctx context.Context, tokenHash string) (models.Session, error) + func (s *Store) GetSetting(ctx context.Context, name string) (string, error) + func (s *Store) GetTOTP(ctx context.Context, userID int64) (models.TOTP, error) + func (s *Store) GetUser(ctx context.Context, id int64) (models.User, error) + func (s *Store) GetUserByEmail(ctx context.Context, email string) (models.User, error) + func (s *Store) HasPending(ctx context.Context) (bool, error) + func (s *Store) HasUsers(ctx context.Context) (bool, error) + func (s *Store) HeartbeatJob(ctx context.Context, publicID, tokenHash string, extend time.Duration, ...) (cancel bool, err error) + func (s *Store) IdentityProviders(ctx context.Context) (map[int64][]string, error) + func (s *Store) JobStats(ctx context.Context, failedSince time.Time) ([]models.JobKindStats, error) + func (s *Store) LastFinishedStates(ctx context.Context, kind string, n int, since time.Time) ([]string, error) + func (s *Store) LeaseJob(ctx context.Context, req models.LeaseRequest, at time.Time) (models.Job, bool, error) + func (s *Store) ListAccessTokens(ctx context.Context, userID int64) ([]models.AccessToken, error) + func (s *Store) ListAuditEvents(ctx context.Context, f store.AuditFilter) ([]models.AuditEvent, error) + func (s *Store) ListAuthProviders(ctx context.Context) ([]models.AuthProvider, error) + func (s *Store) ListJobSchedules(ctx context.Context, kind string) ([]models.JobSchedule, error) + func (s *Store) ListJobs(ctx context.Context, f models.JobFilter) ([]models.Job, error) + func (s *Store) ListPasskeys(ctx context.Context, userID int64) ([]models.Passkey, error) + func (s *Store) ListUserIdentities(ctx context.Context, userID int64) ([]models.Identity, error) + func (s *Store) ListUsers(ctx context.Context) ([]models.User, error) + func (s *Store) ListUsersWithIntegration(ctx context.Context, provider string) ([]int64, error) + func (s *Store) ListWorkers(ctx context.Context, since time.Time) ([]models.WorkerInstance, error) + func (s *Store) MaxConns() int + func (s *Store) Migrate(ctx context.Context) ([]*goose.MigrationResult, error) + func (s *Store) MigrateDown(ctx context.Context) (*goose.MigrationResult, error) + func (s *Store) MigrateTo(ctx context.Context, version int64) ([]*goose.MigrationResult, error) + func (s *Store) MigrationStatus(ctx context.Context) ([]*goose.MigrationStatus, error) + func (s *Store) NonceSeen(ctx context.Context, nonce string) (bool, error) + func (s *Store) PasswordResetUser(ctx context.Context, tokenHash string) (models.User, error) + func (s *Store) Ping(ctx context.Context) error + func (s *Store) PurgeAuditEvents(ctx context.Context, before time.Time) (int64, error) + func (s *Store) PurgeFailures(ctx context.Context, before time.Time) (int64, error) + func (s *Store) PurgeJobs(ctx context.Context, before time.Time) (int64, error) + func (s *Store) PurgeNonces(ctx context.Context, before time.Time) (int64, error) + func (s *Store) PurgeWorkers(ctx context.Context, before time.Time) (int64, error) + func (s *Store) PutAuthProvider(ctx context.Context, p models.AuthProvider) error + func (s *Store) PutIdentity(ctx context.Context, id models.Identity) error + func (s *Store) PutIntegration(ctx context.Context, userID int64, provider string, data []byte) error + func (s *Store) PutJobSchedule(ctx context.Context, j models.JobSchedule) error + func (s *Store) PutPendingTOTP(ctx context.Context, userID int64, secret string) error + func (s *Store) PutSetting(ctx context.Context, name, value string) error + func (s *Store) ReapExpiredLeases(ctx context.Context, at time.Time, backoff func(models.Job) time.Duration) ([]models.Job, error) + func (s *Store) RecordFailure(ctx context.Context, key string, at time.Time) error + func (s *Store) Rekey(ctx context.Context, dryRun bool) (RekeyStats, error) + func (s *Store) ReleaseJob(ctx context.Context, publicID, tokenHash string, at time.Time) error + func (s *Store) RenamePasskey(ctx context.Context, userID int64, credentialID, name string) error + func (s *Store) ReplaceRecoveryCodes(ctx context.Context, userID int64, hashes []string) error + func (s *Store) RunningJob(ctx context.Context, publicID, tokenHash string) (models.Job, error) + func (s *Store) SchemaVersion(ctx context.Context) (int64, error) + func (s *Store) SetUserJobPriority(ctx context.Context, userID int64, priority int) error + func (s *Store) SetUserRole(ctx context.Context, userID int64, role string) error + func (s *Store) SetUserStrengthLevelAuto(ctx context.Context, userID int64, enabled bool) error + func (s *Store) SetUserStrengthLevelBulk(ctx context.Context, userID int64, enabled bool) error + func (s *Store) SettingsGeneration(ctx context.Context) (int64, error) + func (s *Store) Stats(ctx context.Context) (store.Stats, error) + func (s *Store) TouchWorker(ctx context.Context, id string, kinds []string, version string, at time.Time) error + func (s *Store) TwoFactorUsers(ctx context.Context) (map[int64]bool, error) + func (s *Store) UpdatePasskeyUse(ctx context.Context, credentialID, credential string, signCount uint32) error + func (s *Store) UpdateUserHiddenColumns(ctx context.Context, userID int64, keys []string) error + func (s *Store) UpdateUserProfile(ctx context.Context, userID int64, name, email string, heightCm *float64) error + func (s *Store) UpdateUserSettings(ctx context.Context, userID int64, athleteDefault bool, ranking []string) error + func (s *Store) UpdateUserTimezone(ctx context.Context, userID int64, timezone string) error + func (s *Store) UseNonce(ctx context.Context, nonce string, expires time.Time) (bool, error) + func (s *Store) UseRecoveryCode(ctx context.Context, userID int64, hash string) (bool, error) + func (s *Store) UseTOTPStep(ctx context.Context, userID, step int64) (bool, error) + func (s *Store) UserByPasskeyHandle(ctx context.Context, handle string) (models.User, error) + func (s *Store) UserBySession(ctx context.Context, tokenHash string) (models.User, error) + func (s *Store) UserByTokenHash(ctx context.Context, tokenHash string) (models.User, error) + func (s *Store) UserProviders(ctx context.Context, userID int64) ([]string, error)