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, namespace string, featureIn credit.Feature) (credit.Feature, error)
- func (c *PostgresConnector) CreateGrant(ctx context.Context, namespace string, grantIn credit.Grant) (credit.Grant, error)
- func (c *PostgresConnector) CreateLedger(ctx context.Context, namespace string, ledgerIn credit.Ledger) (credit.Ledger, error)
- func (c *PostgresConnector) DeleteFeature(ctx context.Context, namespace string, id ulid.ULID) error
- func (a *PostgresConnector) GetBalance(ctx context.Context, namespace string, ledgerID ulid.ULID, cutline time.Time) (credit.Balance, error)
- func (c *PostgresConnector) GetFeature(ctx context.Context, namespace string, id ulid.ULID) (credit.Feature, error)
- func (c *PostgresConnector) GetGrant(ctx context.Context, namespace string, id ulid.ULID) (credit.Grant, error)
- func (c *PostgresConnector) GetHighWatermark(ctx context.Context, namespace string, ledgerID ulid.ULID) (credit.HighWatermark, error)
- func (a *PostgresConnector) GetHistory(ctx context.Context, namespace string, ledgerID ulid.ULID, from time.Time, ...) (credit.LedgerEntryList, error)
- func (c *PostgresConnector) ListFeatures(ctx context.Context, namespace string, params credit.ListFeaturesParams) ([]credit.Feature, error)
- func (c *PostgresConnector) ListGrants(ctx context.Context, namespace string, params credit.ListGrantsParams) ([]credit.Grant, error)
- func (c *PostgresConnector) ListLedgers(ctx context.Context, namespace string, params credit.ListLedgersParams) ([]credit.Ledger, error)
- func (c *PostgresConnector) Reset(ctx context.Context, namespace string, reset credit.Reset) (credit.Reset, []credit.Grant, error)
- func (c *PostgresConnector) VoidGrant(ctx context.Context, namespace string, grantIn credit.Grant) (credit.Grant, error)
- 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, namespace string, 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, namespace string, id ulid.ULID) error
DeleteFeature deletes a feature.
func (*PostgresConnector) GetBalance ¶
func (*PostgresConnector) GetFeature ¶
func (c *PostgresConnector) GetFeature(ctx context.Context, namespace string, id ulid.ULID) (credit.Feature, error)
GetFeature gets a single feature by ID.
func (*PostgresConnector) GetHighWatermark ¶
func (c *PostgresConnector) GetHighWatermark(ctx context.Context, namespace string, ledgerID ulid.ULID) (credit.HighWatermark, error)
GetHighWatermark returns the high watermark for the given credit and subject pair.
func (*PostgresConnector) GetHistory ¶
func (*PostgresConnector) ListFeatures ¶
func (c *PostgresConnector) ListFeatures(ctx context.Context, namespace string, params credit.ListFeaturesParams) ([]credit.Feature, error)
ListFeatures lists features.
func (*PostgresConnector) ListGrants ¶
func (c *PostgresConnector) ListGrants(ctx context.Context, namespace string, params credit.ListGrantsParams) ([]credit.Grant, error)
func (*PostgresConnector) ListLedgers ¶
func (c *PostgresConnector) ListLedgers(ctx context.Context, namespace string, params credit.ListLedgersParams) ([]credit.Ledger, error)
type TransactionManager ¶
type TransactionManager interface {
// contains filtered or unexported methods
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.