Documentation
¶
Index ¶
- Constants
- func BackupStopped(ctx context.Context, path, destination string) (func(), error)
- func IsPostgres(value string) bool
- func Restore(ctx context.Context, source, destination string, replace bool) (string, error)
- type Checkpoint
- type Search
- type Store
- func (s *Store) Accounts(ctx context.Context, id, cursor string, limit int, now time.Time) (ranjit.Page[ranjit.Account], error)
- func (s *Store) Backup(ctx context.Context, destination string) error
- func (s *Store) Claim(ctx context.Context, now time.Time, lease time.Duration) (ranjit.Job, error)
- func (s *Store) ClaimSelected(ctx context.Context, now time.Time, lease time.Duration, ...) (ranjit.Job, error)
- func (s *Store) ClaimWebhook(ctx context.Context, now time.Time) (WebhookAttempt, error)
- func (s *Store) Close() error
- func (s *Store) Complete(ctx context.Context, j ranjit.Job, batch provider.Snapshot, now time.Time) error
- func (s *Store) ConfiguredConnections(ctx context.Context, institutions []string) (map[string]bool, error)
- func (s *Store) Connection(ctx context.Context, id string, now time.Time) (ranjit.Connection, error)
- func (s *Store) Connections(ctx context.Context, customer, cursor string, limit int, now time.Time) (ranjit.Page[ranjit.Connection], error)
- func (s *Store) CreateAuthorizedConnection(ctx context.Context, c ranjit.Connection) error
- func (s *Store) CreateConnection(ctx context.Context, c ranjit.Connection, tokenHash string, deadline time.Time) error
- func (s *Store) CreateConnectionOnce(ctx context.Context, c ranjit.Connection, tokenHash any, deadline time.Time, ...) (ranjit.Connection, time.Time, error)
- func (s *Store) Decide(ctx context.Context, hash string, approve bool, now time.Time) (ranjit.Connection, error)
- func (s *Store) EnableWebhooks(destination string)
- func (s *Store) Enqueue(ctx context.Context, id string, now time.Time) (ranjit.Job, error)
- func (s *Store) Expire(ctx context.Context, now time.Time) error
- func (s *Store) Fail(ctx context.Context, j ranjit.Job, code string, now time.Time) error
- func (s *Store) FailAfter(ctx context.Context, j ranjit.Job, code string, now time.Time, ...) error
- func (s *Store) FinishWebhook(ctx context.Context, attempt WebhookAttempt, statusCode int, now time.Time) error
- func (s *Store) Import(ctx context.Context, customer, account string, input statement.Statement, ...) (ranjit.ImportResult, error)
- func (s *Store) Job(ctx context.Context, id string) (ranjit.Job, error)
- func (s *Store) Pause(ctx context.Context, id string, now time.Time) error
- func (s *Store) PendingConsent(ctx context.Context, hash string, now time.Time) (ranjit.Connection, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) PreviewImport(ctx context.Context, customer, account string, input statement.Statement, ...) (ranjit.ImportResult, error)
- func (s *Store) Queues(ctx context.Context, now time.Time) (ranjit.QueueStatus, ranjit.QueueStatus, error)
- func (s *Store) Renew(ctx context.Context, id, binding string, deadline, now time.Time) (ranjit.Connection, error)
- func (s *Store) ReplayConnection(ctx context.Context, key, fingerprint string, now time.Time) (ranjit.Connection, time.Time, error)
- func (s *Store) RetryWebhook(ctx context.Context, id string, now time.Time) error
- func (s *Store) Revoke(ctx context.Context, id string, now time.Time) error
- func (s *Store) Schedule(ctx context.Context, now time.Time, interval time.Duration) error
- func (s *Store) ScheduleSelected(ctx context.Context, now time.Time, interval time.Duration, ...) error
- func (s *Store) SearchTransactions(ctx context.Context, f Search, now time.Time) (ranjit.Page[ranjit.Transaction], error)
- func (s *Store) Status(ctx context.Context, id string, now time.Time) (ranjit.ConnectionStatus, error)
- func (s *Store) Transactions(ctx context.Context, accountID, cursor string, limit int, now time.Time) (ranjit.Page[ranjit.Transaction], error)
- func (s *Store) WebhookDeliveries(ctx context.Context, cursor string, limit int) (ranjit.Page[ranjit.WebhookDelivery], error)
- func (s *Store) Yield(ctx context.Context, j ranjit.Job, now time.Time) error
- type WebhookAttempt
Constants ¶
const IdempotencyTTL = 24 * time.Hour
const MaxAttempts = 5
const WebhookMaxAttempts = 8
const WebhookRetention = 7 * 24 * time.Hour
Variables ¶
This section is empty.
Functions ¶
func BackupStopped ¶ added in v0.2.0
BackupStopped retains an exclusive lock until the caller completes an update.
func IsPostgres ¶ added in v0.3.0
Types ¶
type Checkpoint ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Backup ¶ added in v0.2.0
Backup creates a consistent standalone SQLite snapshot without stopping readers. An existing destination is never replaced, even if another process creates it.
func (*Store) ClaimSelected ¶
func (*Store) ClaimWebhook ¶ added in v0.4.0
func (*Store) ConfiguredConnections ¶
func (s *Store) ConfiguredConnections(ctx context.Context, institutions []string) (map[string]bool, error)
ConfiguredConnections excludes profiles absent from this process. A separate CLI process may add a profile while the server still has its old configuration.
func (*Store) Connection ¶
func (*Store) Connections ¶
func (*Store) CreateAuthorizedConnection ¶
CreateAuthorizedConnection persists the operator's local grant and first job atomically.
func (*Store) CreateConnection ¶
func (*Store) CreateConnectionOnce ¶ added in v0.4.0
func (s *Store) CreateConnectionOnce(ctx context.Context, c ranjit.Connection, tokenHash any, deadline time.Time, key, fingerprint string) (ranjit.Connection, time.Time, error)
CreateConnectionOnce commits the request identity, grant and initial job together. Concurrent callers may verify credentials, but only the winning grant is persisted.
func (*Store) Decide ¶
func (s *Store) Decide(ctx context.Context, hash string, approve bool, now time.Time) (ranjit.Connection, error)
Decide consumes the authorization token and queues the first sync in the same transaction.
func (*Store) EnableWebhooks ¶ added in v0.4.0
EnableWebhooks must be called before starting workers. A changed destination does not inherit deliveries containing another endpoint's customer metadata.
func (*Store) FinishWebhook ¶ added in v0.4.0
func (*Store) PendingConsent ¶
func (*Store) PreviewImport ¶ added in v0.2.0
func (*Store) Queues ¶ added in v0.4.0
func (s *Store) Queues(ctx context.Context, now time.Time) (ranjit.QueueStatus, ranjit.QueueStatus, error)
func (*Store) ReplayConnection ¶ added in v0.4.0
func (*Store) RetryWebhook ¶ added in v0.4.0
func (*Store) Revoke ¶
Revoke removes normalized data before returning. The connection record is retained.