Documentation
¶
Index ¶
- func BuildConnectionDSN(cfg Config) string
- type Config
- type DBTX
- type PostgresStoreMigrater
- func (mig *PostgresStoreMigrater) Close() error
- func (mig *PostgresStoreMigrater) Down() error
- func (mig *PostgresStoreMigrater) Force(version int) error
- func (mig *PostgresStoreMigrater) List() ([]string, error)
- func (mig *PostgresStoreMigrater) SetLogger(logger migrate.Logger)
- func (mig *PostgresStoreMigrater) To(version uint) error
- func (mig *PostgresStoreMigrater) Up() error
- func (mig *PostgresStoreMigrater) Version() (uint, bool, error)
- type Queries
- func (q *Queries) CouponExists(ctx context.Context, id string) (bool, error)
- func (q *Queries) CustomerExists(ctx context.Context, id string) (bool, error)
- func (q *Queries) DeleteAllCoupons(ctx context.Context) error
- func (q *Queries) DeleteAllCustomers(ctx context.Context) error
- func (q *Queries) DeleteAllPrices(ctx context.Context) error
- func (q *Queries) DeleteAllProducts(ctx context.Context) error
- func (q *Queries) DeleteAllSubscriptions(ctx context.Context) error
- func (q *Queries) DeleteCoupon(ctx context.Context, id string) error
- func (q *Queries) DeleteCurrentSyncState(ctx context.Context) error
- func (q *Queries) DeletePrice(ctx context.Context, id string) error
- func (q *Queries) DeleteProduct(ctx context.Context, id string) error
- func (q *Queries) GetCurrentSyncState(ctx context.Context) (StripeSyncState, error)
- func (q *Queries) PriceExists(ctx context.Context, id string) (bool, error)
- func (q *Queries) ProductExists(ctx context.Context, id string) (bool, error)
- func (q *Queries) SetSyncState(ctx context.Context, lastEvent int64) error
- func (q *Queries) UpdateSubscriptionDiscount(ctx context.Context, arg UpdateSubscriptionDiscountParams) error
- func (q *Queries) UpsertCoupons(ctx context.Context, arg UpsertCouponsParams) error
- func (q *Queries) UpsertCustomer(ctx context.Context, arg UpsertCustomerParams) error
- func (q *Queries) UpsertPrice(ctx context.Context, arg UpsertPriceParams) error
- func (q *Queries) UpsertProduct(ctx context.Context, arg UpsertProductParams) error
- func (q *Queries) UpsertSubscription(ctx context.Context, arg UpsertSubscriptionParams) error
- func (q *Queries) UpsertSubscriptionItem(ctx context.Context, arg UpsertSubscriptionItemParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Store
- type StripeCoupon
- type StripeCustomer
- type StripePrice
- type StripeProduct
- type StripeSubscription
- type StripeSubscriptionItem
- type StripeSyncState
- type UpdateSubscriptionDiscountParams
- type UpsertCouponsParams
- type UpsertCustomerParams
- type UpsertPriceParams
- type UpsertProductParams
- type UpsertSubscriptionItemParams
- type UpsertSubscriptionParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConnectionDSN ¶
Types ¶
type PostgresStoreMigrater ¶
type PostgresStoreMigrater struct {
// contains filtered or unexported fields
}
func (*PostgresStoreMigrater) Close ¶
func (mig *PostgresStoreMigrater) Close() error
func (*PostgresStoreMigrater) Down ¶
func (mig *PostgresStoreMigrater) Down() error
func (*PostgresStoreMigrater) Force ¶
func (mig *PostgresStoreMigrater) Force(version int) error
func (*PostgresStoreMigrater) List ¶
func (mig *PostgresStoreMigrater) List() ([]string, error)
func (*PostgresStoreMigrater) SetLogger ¶
func (mig *PostgresStoreMigrater) SetLogger(logger migrate.Logger)
func (*PostgresStoreMigrater) To ¶
func (mig *PostgresStoreMigrater) To(version uint) error
func (*PostgresStoreMigrater) Up ¶
func (mig *PostgresStoreMigrater) Up() error
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CouponExists ¶ added in v0.1.1
func (*Queries) CustomerExists ¶
func (*Queries) DeleteAllCoupons ¶ added in v0.1.1
func (*Queries) DeleteAllCustomers ¶
func (*Queries) DeleteAllSubscriptions ¶
func (*Queries) DeleteCoupon ¶ added in v0.1.1
func (*Queries) DeleteCurrentSyncState ¶
func (*Queries) DeleteProduct ¶
func (*Queries) GetCurrentSyncState ¶
func (q *Queries) GetCurrentSyncState(ctx context.Context) (StripeSyncState, error)
func (*Queries) PriceExists ¶
func (*Queries) ProductExists ¶
func (*Queries) SetSyncState ¶
func (*Queries) UpdateSubscriptionDiscount ¶ added in v0.1.1
func (q *Queries) UpdateSubscriptionDiscount(ctx context.Context, arg UpdateSubscriptionDiscountParams) error
func (*Queries) UpsertCoupons ¶ added in v0.1.1
func (q *Queries) UpsertCoupons(ctx context.Context, arg UpsertCouponsParams) error
func (*Queries) UpsertCustomer ¶
func (q *Queries) UpsertCustomer(ctx context.Context, arg UpsertCustomerParams) error
func (*Queries) UpsertPrice ¶
func (q *Queries) UpsertPrice(ctx context.Context, arg UpsertPriceParams) error
func (*Queries) UpsertProduct ¶
func (q *Queries) UpsertProduct(ctx context.Context, arg UpsertProductParams) error
func (*Queries) UpsertSubscription ¶
func (q *Queries) UpsertSubscription(ctx context.Context, arg UpsertSubscriptionParams) error
func (*Queries) UpsertSubscriptionItem ¶
func (q *Queries) UpsertSubscriptionItem(ctx context.Context, arg UpsertSubscriptionItemParams) error
type Store ¶ added in v0.2.1
type Store struct {
Q *Queries
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewPostgresTestStore ¶
func (*Store) GetMigrater ¶ added in v0.2.1
func (pgs *Store) GetMigrater(cfg Config) (*PostgresStoreMigrater, error)
type StripeCoupon ¶ added in v0.1.1
type StripeCoupon struct {
ID string
Object string
AmountOff sql.NullInt64
Created int64
Currency sql.NullString
Duration string
DurationInMonths sql.NullInt64
Livemode bool
MaxRedemptions sql.NullInt64
Metadata pqtype.NullRawMessage
Name string
PercentOff sql.NullFloat64
RedeemBy sql.NullInt64
TimesRedeemed sql.NullInt64
Valid bool
AppliesTo pqtype.NullRawMessage
UpdatedAt time.Time
}
type StripeCustomer ¶
type StripeCustomer struct {
ID string
Object string
Address pqtype.NullRawMessage
Description sql.NullString
Email sql.NullString
Metadata pqtype.NullRawMessage
Name sql.NullString
Phone sql.NullString
Shipping pqtype.NullRawMessage
Balance sql.NullInt64
Created int64
Currency sql.NullString
DefaultSource sql.NullString
Delinquent bool
Discount pqtype.NullRawMessage
InvoicePrefix string
InvoiceSettings pqtype.NullRawMessage
Livemode bool
NextInvoiceSequence int64
PreferredLocales []string
TaxExempt string
Deleted bool
UpdatedAt time.Time
}
type StripePrice ¶
type StripePrice struct {
ID string
Object string
Active bool
Currency string
Metadata pqtype.NullRawMessage
Nickname sql.NullString
Recurring pqtype.NullRawMessage
Type string
UnitAmount sql.NullInt64
BillingScheme string
Created int64
Livemode bool
LookupKey sql.NullString
TiersMode sql.NullString
TransformQuantity pqtype.NullRawMessage
UnitAmountDecimal sql.NullFloat64
Product string
UpdatedAt time.Time
}
type StripeProduct ¶
type StripeProduct struct {
ID string
Object string
Active bool
Description sql.NullString
Metadata pqtype.NullRawMessage
Name string
Created int64
Images []string
Livemode bool
PackageDimensions pqtype.NullRawMessage
Shippable bool
StatementDescriptor sql.NullString
UnitLabel sql.NullString
Updated int64
Url sql.NullString
UpdatedAt time.Time
}
type StripeSubscription ¶
type StripeSubscription struct {
ID string
Object string
CancelAtPeriodEnd bool
CurrentPeriodEnd int64
CurrentPeriodStart int64
DefaultPaymentMethod sql.NullString
Metadata pqtype.NullRawMessage
PendingSetupIntent sql.NullString
PendingUpdate pqtype.NullRawMessage
Status string
ApplicationFeePercent sql.NullFloat64
BillingCycleAnchor int64
BillingThresholds pqtype.NullRawMessage
CancelAt sql.NullInt64
CanceledAt sql.NullInt64
CollectionMethod string
Created int64
DaysUntilDue sql.NullInt64
DefaultSource sql.NullString
DefaultTaxRates pqtype.NullRawMessage
EndedAt sql.NullInt64
Livemode bool
NextPendingInvoiceItemInvoice sql.NullInt64
PauseCollection pqtype.NullRawMessage
PendingInvoiceItemInterval pqtype.NullRawMessage
StartDate int64
TransferData pqtype.NullRawMessage
TrialEnd sql.NullInt64
TrialStart sql.NullInt64
DiscountID sql.NullString
DiscountStart sql.NullInt64
DiscountEnd sql.NullInt64
DiscountCoupon sql.NullString
DiscountDeleted sql.NullBool
DiscountPromotionCode sql.NullString
Schedule sql.NullString
Customer string
UpdatedAt time.Time
}
type StripeSubscriptionItem ¶
type StripeSubscriptionItem struct {
ID string
Object string
BillingThresholds pqtype.NullRawMessage
Created int64
Metadata pqtype.NullRawMessage
Quantity int64
Price string
Subscription string
TaxRates pqtype.NullRawMessage
}
type StripeSyncState ¶
type UpdateSubscriptionDiscountParams ¶ added in v0.1.1
type UpdateSubscriptionDiscountParams struct {
DiscountID sql.NullString
DiscountStart sql.NullInt64
DiscountEnd sql.NullInt64
DiscountCoupon sql.NullString
DiscountDeleted sql.NullBool
DiscountPromotionCode sql.NullString
}
type UpsertCouponsParams ¶ added in v0.1.1
type UpsertCouponsParams struct {
ID string
Object string
AmountOff sql.NullInt64
Created int64
Currency sql.NullString
Duration string
DurationInMonths sql.NullInt64
Livemode bool
MaxRedemptions sql.NullInt64
Metadata pqtype.NullRawMessage
Name string
PercentOff sql.NullFloat64
RedeemBy sql.NullInt64
TimesRedeemed sql.NullInt64
Valid bool
AppliesTo pqtype.NullRawMessage
}
type UpsertCustomerParams ¶
type UpsertCustomerParams struct {
ID string
Object string
Address pqtype.NullRawMessage
Description sql.NullString
Email sql.NullString
Metadata pqtype.NullRawMessage
Name sql.NullString
Phone sql.NullString
Shipping pqtype.NullRawMessage
Balance sql.NullInt64
Created int64
Currency sql.NullString
Delinquent bool
Discount pqtype.NullRawMessage
InvoicePrefix string
InvoiceSettings pqtype.NullRawMessage
Livemode bool
NextInvoiceSequence int64
PreferredLocales []string
TaxExempt string
Deleted bool
}
type UpsertPriceParams ¶
type UpsertPriceParams struct {
ID string
Object string
Active bool
BillingScheme string
Created int64
Currency string
Livemode bool
LookupKey sql.NullString
Metadata pqtype.NullRawMessage
Nickname sql.NullString
Recurring pqtype.NullRawMessage
Type string
UnitAmount sql.NullInt64
TiersMode sql.NullString
TransformQuantity pqtype.NullRawMessage
UnitAmountDecimal sql.NullFloat64
Product string
}
type UpsertProductParams ¶
type UpsertProductParams struct {
ID string
Object string
Active bool
Description sql.NullString
Metadata pqtype.NullRawMessage
Name string
Created int64
Images []string
Livemode bool
PackageDimensions pqtype.NullRawMessage
Shippable bool
StatementDescriptor sql.NullString
UnitLabel sql.NullString
Updated int64
Url sql.NullString
}
type UpsertSubscriptionItemParams ¶
type UpsertSubscriptionItemParams struct {
ID string
Object string
BillingThresholds pqtype.NullRawMessage
Created int64
Metadata pqtype.NullRawMessage
Price string
Quantity int64
Subscription string
TaxRates pqtype.NullRawMessage
}
type UpsertSubscriptionParams ¶
type UpsertSubscriptionParams struct {
ID string
Object string
CancelAtPeriodEnd bool
CurrentPeriodEnd int64
CurrentPeriodStart int64
Metadata pqtype.NullRawMessage
PendingUpdate pqtype.NullRawMessage
Status string
ApplicationFeePercent sql.NullFloat64
BillingCycleAnchor int64
BillingThresholds pqtype.NullRawMessage
CancelAt sql.NullInt64
CanceledAt sql.NullInt64
CollectionMethod string
Created int64
DaysUntilDue sql.NullInt64
DefaultTaxRates pqtype.NullRawMessage
EndedAt sql.NullInt64
Livemode bool
NextPendingInvoiceItemInvoice sql.NullInt64
PauseCollection pqtype.NullRawMessage
PendingInvoiceItemInterval pqtype.NullRawMessage
StartDate int64
TransferData pqtype.NullRawMessage
TrialEnd sql.NullInt64
TrialStart sql.NullInt64
DiscountID sql.NullString
DiscountStart sql.NullInt64
DiscountEnd sql.NullInt64
DiscountCoupon sql.NullString
DiscountDeleted sql.NullBool
DiscountPromotionCode sql.NullString
Customer string
}
Click to show internal directories.
Click to hide internal directories.