store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MaxAttempts = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	Store *Store
	Job   ranjit.Job
	Now   func() time.Time
}

func (Checkpoint) Load

func (c Checkpoint) Load(ctx context.Context, endpoint string) ([]byte, error)

func (Checkpoint) Save

func (c Checkpoint) Save(ctx context.Context, endpoint string, body []byte) error

type Store

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

func Open

func Open(ctx context.Context, path string) (*Store, error)

func (*Store) Accounts

func (s *Store) Accounts(ctx context.Context, id, cursor string, limit int, now time.Time) (ranjit.Page[ranjit.Account], error)

func (*Store) Claim

func (s *Store) Claim(ctx context.Context, now time.Time, lease time.Duration) (ranjit.Job, error)

func (*Store) ClaimSelected

func (s *Store) ClaimSelected(ctx context.Context, now time.Time, lease time.Duration, selected map[string]bool) (ranjit.Job, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Complete

func (s *Store) Complete(ctx context.Context, j ranjit.Job, batch provider.Snapshot, now time.Time) error

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 (s *Store) Connection(ctx context.Context, id string, now time.Time) (ranjit.Connection, error)

func (*Store) Connections

func (s *Store) Connections(ctx context.Context, customer, cursor string, limit int, now time.Time) (ranjit.Page[ranjit.Connection], error)

func (*Store) CreateAuthorizedConnection

func (s *Store) CreateAuthorizedConnection(ctx context.Context, c ranjit.Connection) error

CreateAuthorizedConnection persists the operator's local grant and first job atomically.

func (*Store) CreateConnection

func (s *Store) CreateConnection(ctx context.Context, c ranjit.Connection, tokenHash string, deadline time.Time) error

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) Enqueue

func (s *Store) Enqueue(ctx context.Context, id string, now time.Time) (ranjit.Job, error)

func (*Store) Expire

func (s *Store) Expire(ctx context.Context, now time.Time) error

func (*Store) Fail

func (s *Store) Fail(ctx context.Context, j ranjit.Job, code string, now time.Time) error

func (*Store) FailAfter

func (s *Store) FailAfter(ctx context.Context, j ranjit.Job, code string, now time.Time, retryAfter time.Duration) error

func (*Store) Import

func (s *Store) Import(ctx context.Context, customer, account string, input statement.Statement, now time.Time) (ranjit.ImportResult, error)

func (*Store) Job

func (s *Store) Job(ctx context.Context, id string) (ranjit.Job, error)

func (*Store) PendingConsent

func (s *Store) PendingConsent(ctx context.Context, hash string, now time.Time) (ranjit.Connection, error)

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

func (*Store) Revoke

func (s *Store) Revoke(ctx context.Context, id string, now time.Time) error

Revoke removes normalized data before returning. The connection record is retained.

func (*Store) Schedule

func (s *Store) Schedule(ctx context.Context, now time.Time, interval time.Duration) error

func (*Store) ScheduleSelected

func (s *Store) ScheduleSelected(ctx context.Context, now time.Time, interval time.Duration, selected map[string]bool) error

func (*Store) Status

func (s *Store) Status(ctx context.Context, id string, now time.Time) (ranjit.ConnectionStatus, error)

func (*Store) Transactions

func (s *Store) Transactions(ctx context.Context, accountID, cursor string, limit int, now time.Time) (ranjit.Page[ranjit.Transaction], error)

func (*Store) Yield

func (s *Store) Yield(ctx context.Context, j ranjit.Job, now time.Time) error

Yield continues a healthy, long sync without spending a failure attempt.

Jump to

Keyboard shortcuts

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