Documentation
¶
Index ¶
- func NewPostgresConnector(logger *slog.Logger, db *db.Client, streamingConnector streaming.Connector, ...) credit.Connector
- func Open(databaseURL string) (*db.Client, error)
- type PostgresConnector
- func (c *PostgresConnector) CreateFeature(ctx context.Context, featureIn credit.Feature) (credit.Feature, error)
- func (c *PostgresConnector) CreateGrant(ctx context.Context, grantIn credit.Grant) (credit.Grant, error)
- func (c *PostgresConnector) CreateLedger(ctx context.Context, ledgerIn credit.Ledger) (credit.Ledger, error)
- func (c *PostgresConnector) DeleteFeature(ctx context.Context, id credit.NamespacedFeatureID) error
- func (a *PostgresConnector) GetBalance(ctx context.Context, ledgerID credit.NamespacedLedgerID, cutline time.Time) (credit.Balance, error)
- func (c *PostgresConnector) GetFeature(ctx context.Context, id credit.NamespacedFeatureID) (credit.Feature, error)
- func (c *PostgresConnector) GetGrant(ctx context.Context, grantID credit.NamespacedGrantID) (credit.Grant, error)
- func (c *PostgresConnector) GetHighWatermark(ctx context.Context, ledgerID credit.NamespacedLedgerID) (credit.HighWatermark, error)
- func (a *PostgresConnector) GetHistory(ctx context.Context, ledgerID credit.NamespacedLedgerID, from time.Time, ...) (credit.LedgerEntryList, error)
- func (c *PostgresConnector) ListFeatures(ctx context.Context, params credit.ListFeaturesParams) ([]credit.Feature, error)
- func (c *PostgresConnector) ListGrants(ctx context.Context, params credit.ListGrantsParams) ([]credit.Grant, error)
- func (c *PostgresConnector) ListLedgers(ctx context.Context, params credit.ListLedgersParams) ([]credit.Ledger, error)
- func (c *PostgresConnector) Reset(ctx context.Context, reset credit.Reset) (credit.Reset, []credit.Grant, error)
- func (c *PostgresConnector) VoidGrant(ctx context.Context, grantIn credit.Grant) (credit.Grant, error)
- type PostgresConnectorConfig
- type TransactionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresConnector ¶
Types ¶
type PostgresConnector ¶
type PostgresConnector struct {
// contains filtered or unexported fields
}
func (*PostgresConnector) CreateFeature ¶
func (c *PostgresConnector) CreateFeature(ctx context.Context, featureIn credit.Feature) (credit.Feature, error)
CreateFeature creates a feature.
func (*PostgresConnector) CreateGrant ¶
func (*PostgresConnector) CreateLedger ¶
func (*PostgresConnector) DeleteFeature ¶
func (c *PostgresConnector) DeleteFeature(ctx context.Context, id credit.NamespacedFeatureID) error
DeleteFeature deletes a feature.
func (*PostgresConnector) GetBalance ¶
func (a *PostgresConnector) GetBalance( ctx context.Context, ledgerID credit.NamespacedLedgerID, cutline time.Time, ) (credit.Balance, error)
func (*PostgresConnector) GetFeature ¶
func (c *PostgresConnector) GetFeature(ctx context.Context, id credit.NamespacedFeatureID) (credit.Feature, error)
GetFeature gets a single feature by ID.
func (*PostgresConnector) GetGrant ¶
func (c *PostgresConnector) GetGrant(ctx context.Context, grantID credit.NamespacedGrantID) (credit.Grant, error)
func (*PostgresConnector) GetHighWatermark ¶
func (c *PostgresConnector) GetHighWatermark(ctx context.Context, ledgerID credit.NamespacedLedgerID) (credit.HighWatermark, error)
GetHighWatermark returns the high watermark for the given credit and subject pair.
func (*PostgresConnector) GetHistory ¶
func (a *PostgresConnector) GetHistory( ctx context.Context, ledgerID credit.NamespacedLedgerID, from time.Time, to time.Time, pagination credit.Pagination, ) (credit.LedgerEntryList, error)
func (*PostgresConnector) ListFeatures ¶
func (c *PostgresConnector) ListFeatures(ctx context.Context, params credit.ListFeaturesParams) ([]credit.Feature, error)
ListFeatures lists features.
func (*PostgresConnector) ListGrants ¶
func (c *PostgresConnector) ListGrants(ctx context.Context, params credit.ListGrantsParams) ([]credit.Grant, error)
func (*PostgresConnector) ListLedgers ¶
func (c *PostgresConnector) ListLedgers(ctx context.Context, params credit.ListLedgersParams) ([]credit.Ledger, error)
type PostgresConnectorConfig ¶
type TransactionManager ¶
type TransactionManager interface {
// contains filtered or unexported methods
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.