Documentation
¶
Overview ¶
Package teststore provides a strict transactional fake for operation and adapter conformance tests. It is not a production in-memory database.
Index ¶
- type Store
- func (backend *Store) AcquireDocumentLock(_ context.Context, candidate store.DocumentLock, now time.Time, takeover bool) (store.DocumentLock, bool, error)
- func (backend *Store) AllowAuthAttempt(_ context.Context, keyHash string, now time.Time, window time.Duration, ...) (bool, error)
- func (backend *Store) Begin(ctx context.Context) (store.Transaction, error)
- func (backend *Store) BeginSnapshot(ctx context.Context) (store.Transaction, error)
- func (backend *Store) CancelTask(ctx context.Context, id string) error
- func (backend *Store) ChangePasswordHash(_ context.Context, collection schema.Collection, userID string, ...) error
- func (backend *Store) ClaimTasks(ctx context.Context, request store.TaskClaim) ([]store.Task, error)
- func (backend *Store) CompleteTask(ctx context.Context, id, leaseToken string, output json.RawMessage) error
- func (backend *Store) CreateAPIKey(_ context.Context, key store.AuthAPIKey, sessionTokenHash string, ...) error
- func (backend *Store) CreateAuthToken(_ context.Context, token store.AuthToken) error
- func (backend *Store) CreateSession(_ context.Context, record store.AuthSession, expectedPasswordHash []byte) error
- func (backend *Store) DeleteAPIKey(_ context.Context, collectionID schema.StableID, userID, id string) error
- func (backend *Store) DeletePreference(_ context.Context, collectionID schema.StableID, userID, key string) error
- func (backend *Store) DeletePreferences(_ context.Context, collectionID schema.StableID, userID string) error
- func (backend *Store) DeleteSession(_ context.Context, tokenHash string) error
- func (backend *Store) DeleteUserSession(_ context.Context, collectionID schema.StableID, userID, sessionID string) error
- func (backend *Store) DeleteUserSessions(_ context.Context, collectionID schema.StableID, userID string) error
- func (backend *Store) DismissTaskForTarget(ctx context.Context, id, slug string, target store.DocumentReference) error
- func (backend *Store) EnqueueTask(ctx context.Context, task store.Task) (store.Task, error)
- func (backend *Store) Events() []string
- func (backend *Store) FailTask(ctx context.Context, failure store.TaskFailure) error
- func (backend *Store) FindAPIKey(_ context.Context, id string, now time.Time) (store.AuthAPIKey, error)
- func (backend *Store) FindAuthCredential(_ context.Context, collection schema.Collection, identity string) (store.AuthCredential, error)
- func (backend *Store) FindDocumentLock(_ context.Context, collectionID schema.StableID, documentID string, ...) (store.DocumentLock, error)
- func (backend *Store) FindSession(_ context.Context, tokenHash string, now time.Time) (store.AuthSession, error)
- func (backend *Store) FindTask(ctx context.Context, id string) (store.Task, error)
- func (backend *Store) ForceUnlock(_ context.Context, collectionID schema.StableID, userID string) error
- func (backend *Store) GetPreference(_ context.Context, collectionID schema.StableID, userID, key string) (store.Preference, error)
- func (backend *Store) HeartbeatTask(ctx context.Context, id, leaseToken string, leaseDuration time.Duration) error
- func (backend *Store) ListAPIKeys(_ context.Context, collectionID schema.StableID, userID string, now time.Time) ([]store.AuthAPIKey, error)
- func (backend *Store) ListSessions(_ context.Context, collectionID schema.StableID, userID string, now time.Time) ([]store.AuthSession, error)
- func (backend *Store) ListTasks(ctx context.Context, request store.TaskList) ([]store.Task, error)
- func (backend *Store) LockUploadObjects(ctx context.Context, objectKeys []string) (func(), error)
- func (backend *Store) Ping(ctx context.Context) error
- func (backend *Store) PruneExpiredAuth(ctx context.Context, limit int) (store.AuthPruneResult, error)
- func (backend *Store) PruneTasks(ctx context.Context, limit int) (int, error)
- func (backend *Store) Ready(ctx context.Context, _ schema.Manifest) error
- func (backend *Store) RecordFailedLogin(_ context.Context, collectionID schema.StableID, userID string, now time.Time, ...) (store.AuthCredential, error)
- func (backend *Store) ReleaseDocumentLock(_ context.Context, collectionID schema.StableID, documentID string, ...) error
- func (backend *Store) ReleaseTask(ctx context.Context, id, leaseToken string, delay time.Duration, ...) error
- func (backend *Store) ResetLoginAttempts(_ context.Context, collectionID schema.StableID, userID string, now time.Time) (bool, error)
- func (backend *Store) ResetPasswordWithToken(_ context.Context, collectionID schema.StableID, tokenHash string, hash []byte, ...) (string, error)
- func (backend *Store) RotateSession(_ context.Context, currentHash string, replacement store.AuthSession, ...) error
- func (backend *Store) SetPasswordHash(_ context.Context, collection schema.Collection, userID string, hash []byte, ...) error
- func (backend *Store) SetPreference(_ context.Context, preference store.Preference) (store.Preference, error)
- func (backend *Store) TouchAPIKey(_ context.Context, id string, now time.Time) error
- func (backend *Store) UpgradePasswordHash(_ context.Context, collection schema.Collection, userID string, ...) error
- func (backend *Store) VerifyEmailWithToken(_ context.Context, collectionID schema.StableID, tokenHash string, ...) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AcquireDocumentLock ¶
func (*Store) AllowAuthAttempt ¶
func (*Store) BeginSnapshot ¶
func (*Store) ChangePasswordHash ¶
func (*Store) ClaimTasks ¶
func (*Store) CompleteTask ¶
func (*Store) CreateAPIKey ¶
func (*Store) CreateAuthToken ¶
func (*Store) CreateSession ¶
func (*Store) DeleteAPIKey ¶
func (*Store) DeletePreference ¶
func (*Store) DeletePreferences ¶
func (*Store) DeleteSession ¶
func (*Store) DeleteUserSession ¶
func (*Store) DeleteUserSessions ¶
func (*Store) DismissTaskForTarget ¶
func (*Store) EnqueueTask ¶
func (*Store) FindAPIKey ¶
func (*Store) FindAuthCredential ¶
func (backend *Store) FindAuthCredential(_ context.Context, collection schema.Collection, identity string) (store.AuthCredential, error)
func (*Store) FindDocumentLock ¶
func (*Store) FindSession ¶
func (*Store) ForceUnlock ¶
func (*Store) GetPreference ¶
func (*Store) HeartbeatTask ¶
func (*Store) ListAPIKeys ¶
func (*Store) ListSessions ¶
func (*Store) LockUploadObjects ¶
func (*Store) PruneExpiredAuth ¶
func (*Store) PruneTasks ¶
func (*Store) RecordFailedLogin ¶
func (*Store) ReleaseDocumentLock ¶
func (*Store) ReleaseTask ¶
func (*Store) ResetLoginAttempts ¶
func (*Store) ResetPasswordWithToken ¶
func (*Store) RotateSession ¶
func (*Store) SetPasswordHash ¶
func (*Store) SetPreference ¶
func (backend *Store) SetPreference(_ context.Context, preference store.Preference) (store.Preference, error)
func (*Store) TouchAPIKey ¶
func (*Store) UpgradePasswordHash ¶
Click to show internal directories.
Click to hide internal directories.