Documentation
¶
Overview ¶
Package provider is the boundary for fetching normalized financial data. Consent protocols belong to each integration; this interface does not implement OAuth.
Index ¶
- Constants
- func NewMTLSClient(certificateFile, keyFile string) (*http.Client, error)
- func NewTLSClient() *http.Client
- func ParseBRL(raw json.RawMessage) (ranjit.Money, error)
- func ReadPEM(source string) ([]byte, error)
- func ReadSecretFile(path string) (string, error)
- func RequestJSON(client *http.Client, req *http.Request, result any, now time.Time) (int, error)
- func SyncTime(ctx context.Context, fallback time.Time) time.Time
- func WithCheckpoint(ctx context.Context, c Checkpoint, at time.Time) context.Context
- type Account
- type Checkpoint
- type CredentialSource
- type OAuth
- type OAuthOptions
- type Registry
- type RetryError
- type Snapshot
- type Source
- type Transaction
Constants ¶
const MaxResponseBytes = 2 << 20
Variables ¶
This section is empty.
Functions ¶
func NewMTLSClient ¶
NewMTLSClient uses system roots, a client certificate and bounded network timeouts. Redirects are refused so bank credentials never follow a different destination.
func NewTLSClient ¶
NewTLSClient is used by bank sandboxes that issue a static access token. It has the same timeouts and redirect policy as the mTLS transport.
func ParseBRL ¶
func ParseBRL(raw json.RawMessage) (ranjit.Money, error)
ParseBRL reads decimal JSON numbers or strings without rounding through float64.
func ReadPEM ¶ added in v0.3.0
ReadPEM resolves certificate/key files or secret environment references. PEM values use actual newlines, as provided by the hosting platform's secret store.
func ReadSecretFile ¶
ReadSecretFile accepts a file path or an explicit env:VARIABLE reference. Errors never include credential contents.
func RequestJSON ¶
func SyncTime ¶
SyncTime freezes the requested period across retries, including at midnight. Authentication and consent checks continue to use the actual clock.
func WithCheckpoint ¶
Types ¶
type Checkpoint ¶
type Checkpoint interface {
Load(context.Context, string) ([]byte, error)
Save(context.Context, string, []byte) error
}
Checkpoint retains successful read responses for one leased job. OAuth responses, headers and credentials never enter this boundary.
type CredentialSource ¶
CredentialSource accesses the operator's own account using credentials installed locally. CredentialID binds connections to an application and environment without persisting secrets.
type OAuth ¶
type OAuth struct {
// contains filtered or unexported fields
}
OAuth owns the token cache for exactly one installed bank application. The request function retains each bank's transport and pacing policy.
type OAuthOptions ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry routes each profile to its own credentials and account. Profile names are part of persisted institution IDs; renaming one requires a new connection.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Institutions ¶
func (r *Registry) Institutions() []ranjit.Institution
type RetryError ¶
RetryError lets the worker defer a rate-limited request without holding a lease open.
func (*RetryError) Error ¶
func (*RetryError) Error() string
func (*RetryError) Unwrap ¶
func (*RetryError) Unwrap() error
type Snapshot ¶
type Snapshot struct {
Accounts []Account
Transactions []Transaction
}
type Source ¶
type Source interface {
Institutions() []ranjit.Institution
Fetch(context.Context, ranjit.Connection) (Snapshot, error)
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |