Documentation
¶
Overview ¶
Package ranjit defines the public API types and Go client.
Index ¶
- Variables
- func NewID(prefix string) string
- func StableID(prefix, owner, externalID string) string
- type APIError
- type Account
- type Client
- func (c *Client) Accounts(ctx context.Context, connectionID, cursor string, limit int) (Page[Account], error)
- func (c *Client) Connect(ctx context.Context, input ConnectRequest) (ConnectResponse, error)
- func (c *Client) Connection(ctx context.Context, id string) (Connection, error)
- func (c *Client) Connections(ctx context.Context, customer, cursor string, limit int) (Page[Connection], error)
- func (c *Client) Import(ctx context.Context, input io.Reader, opts ImportOptions) (ImportResult, error)
- func (c *Client) Institutions(ctx context.Context) (Page[Institution], error)
- func (c *Client) Job(ctx context.Context, id string) (Job, error)
- func (c *Client) Pause(ctx context.Context, id string) error
- func (c *Client) PreviewImport(ctx context.Context, input io.Reader, opts ImportOptions) (ImportPreview, error)
- func (c *Client) Renew(ctx context.Context, id string) (Connection, error)
- func (c *Client) Revoke(ctx context.Context, connectionID string) error
- func (c *Client) SearchTransactions(ctx context.Context, f TransactionFilter) (Page[Transaction], error)
- func (c *Client) Status(ctx context.Context, connectionID string) (ConnectionStatus, error)
- func (c *Client) Sync(ctx context.Context, connectionID string) (Job, error)
- func (c *Client) Transactions(ctx context.Context, accountID, cursor string, limit int) (Page[Transaction], error)
- type ConnectRequest
- type ConnectResponse
- type Connection
- type ConnectionStatus
- type ImportOptions
- type ImportPreview
- type ImportResult
- type ImportSample
- type Institution
- type Job
- type Money
- type Page
- type Transaction
- type TransactionFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrConflict = errors.New("connection is not active") ErrInvalid = errors.New("invalid input") ErrConsent = errors.New("authorization link is invalid, expired or already used") ErrLease = errors.New("job lease is no longer valid") ErrProviderCredentials = errors.New("provider credentials are invalid, missing required scopes or have changed") )
Functions ¶
Types ¶
type Client ¶
func NewClientFromEnv ¶ added in v0.3.0
NewClientFromEnv reads the service address and key from backend configuration. The key belongs on the server; never expose it in a browser or mobile client.
func (*Client) Connect ¶
func (c *Client) Connect(ctx context.Context, input ConnectRequest) (ConnectResponse, error)
func (*Client) Connection ¶
func (*Client) Connections ¶
func (*Client) Import ¶
func (c *Client) Import(ctx context.Context, input io.Reader, opts ImportOptions) (ImportResult, error)
Import uploads a local OFX/CSV export. Requests are limited to 8 MiB.
func (*Client) Institutions ¶
func (*Client) PreviewImport ¶ added in v0.2.0
func (c *Client) PreviewImport(ctx context.Context, input io.Reader, opts ImportOptions) (ImportPreview, error)
func (*Client) SearchTransactions ¶ added in v0.2.0
func (c *Client) SearchTransactions(ctx context.Context, f TransactionFilter) (Page[Transaction], error)
func (*Client) Transactions ¶
type ConnectRequest ¶
type ConnectResponse ¶
type ConnectResponse struct {
Connection Connection `json:"connection"`
AuthorizationURL string `json:"authorization_url,omitempty"`
AuthorizationExpiresAt time.Time `json:"authorization_expires_at,omitzero"`
}
type Connection ¶
type Connection struct {
ID string `json:"id"`
CustomerID string `json:"customer_id"`
InstitutionID string `json:"institution_id"`
Provider string `json:"provider"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
ConsentExpiresAt time.Time `json:"consent_expires_at,omitzero"`
LastSyncedAt *time.Time `json:"last_synced_at,omitempty"`
AuthorizationMode string `json:"authorization_mode"`
CredentialID string `json:"-"`
}
func (Connection) HistoryAvailable ¶ added in v0.2.0
func (c Connection) HistoryAvailable() bool
type ConnectionStatus ¶
type ImportOptions ¶
type ImportPreview ¶ added in v0.2.0
type ImportPreview struct {
Result ImportResult `json:"result"`
From string `json:"from"`
Through string `json:"through"`
Sample []ImportSample `json:"sample"`
}
ImportPreview describes a dry run. Its connection ID may not exist yet.
type ImportResult ¶
type ImportResult struct {
New int `json:"new"`
Updated int `json:"updated"`
Unchanged int `json:"unchanged"`
ConnectionID string `json:"connection_id"`
Accounts int `json:"accounts"`
Transactions int `json:"transactions"`
Duplicate bool `json:"duplicate"`
Deduplication string `json:"deduplication"`
}
type ImportSample ¶ added in v0.2.0
type Institution ¶
type Institution struct {
ID string `json:"id"`
Name string `json:"name"`
Provider string `json:"provider"`
Sandbox bool `json:"sandbox"`
ConnectionMode string `json:"connection_mode"`
DataCoverage []string `json:"data_coverage"`
Validation string `json:"validation"`
Profile string `json:"profile,omitempty"`
}
type Job ¶
type Job struct {
ID string `json:"id"`
ConnectionID string `json:"connection_id"`
Status string `json:"status"`
Attempts int `json:"attempts"`
ErrorCode string `json:"error_code,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LeaseToken string `json:"-"`
RequestsCompleted int `json:"requests_completed"`
}
type Money ¶
Money uses signed minor units. BRL 12.34 is 1234; debits are negative. Values are restricted to the exact integer range supported by JSON clients.
type Transaction ¶
type TransactionFilter ¶ added in v0.2.0
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ranjit
command
|
|
|
examples
|
|
|
backend
command
A single-customer backend example.
|
A single-customer backend example. |
|
connect
command
Run with make example.
|
Run with make example. |
|
internal
|
|
|
app
Package app assembles configured providers without exposing credentials to the API.
|
Package app assembles configured providers without exposing credentials to the API. |
|
autostart
Package autostart installs a service for the current user, without elevation.
|
Package autostart installs a service for the current user, without elevation. |
|
filelock
Package filelock coordinates Ranjit processes during offline maintenance.
|
Package filelock coordinates Ranjit processes during offline maintenance. |
|
provider
Package provider is the boundary for fetching normalized financial data.
|
Package provider is the boundary for fetching normalized financial data. |
|
provider/c6
Package c6 reads the operator's own C6 Empresas statement using the bank's own API.
|
Package c6 reads the operator's own C6 Empresas statement using the bank's own API. |
|
provider/efi
Package efi connects to the operator's own Efí account through the official Pix API.
|
Package efi connects to the operator's own Efí account through the official Pix API. |
|
provider/inter
Package inter reads the operator's own Inter Empresas account using the Banking API.
|
Package inter reads the operator's own Inter Empresas account using the Banking API. |
|
provider/santander
Package santander reads the operator's own Santander Empresas account using Bank Account Information.
|
Package santander reads the operator's own Santander Empresas account using Bank Account Information. |
|
provider/sicoob
Package sicoob reads the operator's own Sicoob account using the Conta Corrente API.
|
Package sicoob reads the operator's own Sicoob account using the Conta Corrente API. |
|
statement
Package statement reads local bank exports.
|
Package statement reads local bank exports. |
|
updater
Package updater installs only stable release assets from the Ranjit repository.
|
Package updater installs only stable release assets from the Ranjit repository. |
|
validation
Package validation checks a connector without adding data to the personal database.
|
Package validation checks a connector without adding data to the personal database. |
Click to show internal directories.
Click to hide internal directories.