reader

package
v0.0.0-...-e34b864 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultPageSize is number of elements per page.
	DefaultPageSize = 100
)

Variables

View Source
var ErrReadTargetUnknown = errors.New("unsupported read target")

Functions

This section is empty.

Types

type FinancialAccount

type FinancialAccount struct {
	Id                 string `json:"finAccId"`
	ConnectedAccountId string `json:"conAccId"`
}

FinancialAccount represents an association between Connected Account and Financial account. When ConnectedAccountId is empty then this financial account belongs to the main platform account. Additionally, this struct is used to construct aggregate page token and that is the reason the `json` tags are used. This is a context for the next page token.

type ReadParamsOpts

type ReadParamsOpts struct {
	// ReadForConnectedAccounts enables reading data for specified connected accounts.
	// This takes precedence over ReadForAllConnectedAccounts.
	ReadForConnectedAccounts []string
	// ReadForAllConnectedAccounts enables reading data from all connected accounts
	// instead of only the main account. When true, the connector parallelizes reads
	// across all connected accounts and adds the connected account ID to each result row.
	ReadForAllConnectedAccounts bool
}

ReadParamsOpts defines optional parameters for the Read operation.

type ReadScope

type ReadScope int

ReadScope defines the target scope for a read operation.

It is the high-level branching point for the read execution flow. Non-Treasury scopes execute standard API reads against the platform account or connected accounts. Treasury scopes execute reads against Treasury financial accounts.

const (
	ReadScopeMainAccount ReadScope = iota
	ReadScopeSelectedConnectedAccounts
	ReadScopeAllConnectedAccounts
	ReadScopeMainAccountTreasury
	ReadScopeSelectedConnectedAccountsTreasury
	ReadScopeAllConnectedAccountsTreasury
)

type Strategy

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

func NewStrategy

func NewStrategy(base *core.Base) *Strategy

func (*Strategy) Read

func (s *Strategy) Read(ctx context.Context, params common.ReadParams) (*common.ReadResult, error)

Read retrieves a list of records for the specified object name.

Supported features:

  • NextPage: Pagination is supported. For Connected Accounts and Treasury financial accounts, next-page tokens use aggregate contextual format.
  • Fields: JSONPath-based field selection and on-demand expansion are supported. See https://docs.stripe.com/api/expanding_objects.
  • Incremental Reading: Not supported; the "Since" parameter is ignored.

Domain:

  • Objects owned by the main platform account and Connected Accounts are supported.
  • Treasury API objects are read through their associated financial accounts.

Treasury reads:

Rate limits and concurrency:

  • Stripe rate limits apply per API key and per connected account: https://docs.stripe.com/rate-limits
  • Financial accounts are discovered sequentially.
  • Treasury reads are executed in parallel up to maxReadConcurrency.
  • Lower maxReadConcurrency if rate-limit errors occur.

Parallelization:

  • Connected accounts and financial accounts are discovered sequentially.
  • Requests are then parallelized to improve throughput.

Relevant Stripe documentation:

Jump to

Keyboard shortcuts

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