Documentation
¶
Index ¶
- func WithTx[T any](ctx context.Context, repo Repository, ...) (resp T, err error)
- func WithTxNoValue(ctx context.Context, repo Repository, ...) error
- type Config
- type CreateCustomerInput
- type Customer
- type CustomerExternalMapping
- type CustomerID
- type CustomerRepository
- type CustomerService
- type CustomerUsageAttribution
- type DeleteCustomerInput
- type GetCustomerInput
- type ListCustomersInput
- type NotFoundError
- type Repository
- type Service
- type TxRepository
- type UpdateAfterDeleteError
- type UpdateCustomerInput
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithTx ¶
func WithTx[T any](ctx context.Context, repo Repository, fn func(ctx context.Context, repo TxRepository) (T, error)) (resp T, err error)
func WithTxNoValue ¶
func WithTxNoValue(ctx context.Context, repo Repository, fn func(ctx context.Context, repo TxRepository) error) error
Types ¶
type Config ¶
type Config struct {
Repository Repository
}
type CreateCustomerInput ¶
CreateCustomerInput represents the input for the CreateCustomer method
type Customer ¶
type Customer struct { models.ManagedResource Name string `json:"name"` UsageAttribution CustomerUsageAttribution `json:"usageAttribution"` PrimaryEmail *string `json:"primaryEmail"` Currency *models.CurrencyCode `json:"currency"` BillingAddress *models.Address `json:"billingAddress"` TaxProvider *models.TaxProvider `json:"taxProvider"` InvoicingProvider *models.InvoicingProvider `json:"invoicingProvider"` PaymentProvider *models.PaymentProvider `json:"paymentProvider"` External *CustomerExternalMapping `json:"external"` }
Customer represents a customer
type CustomerExternalMapping ¶
type CustomerExternalMapping struct {
StripeCustomerID *string `json:"stripeCustomerID"`
}
CustomerExternalMapping represents the external mapping for a customer
type CustomerID ¶
type CustomerID models.NamespacedID
func (CustomerID) Validate ¶
func (i CustomerID) Validate() error
type CustomerRepository ¶
type CustomerRepository interface { ListCustomers(ctx context.Context, params ListCustomersInput) (pagination.PagedResponse[Customer], error) CreateCustomer(ctx context.Context, params CreateCustomerInput) (*Customer, error) DeleteCustomer(ctx context.Context, customer DeleteCustomerInput) error GetCustomer(ctx context.Context, customer GetCustomerInput) (*Customer, error) UpdateCustomer(ctx context.Context, params UpdateCustomerInput) (*Customer, error) }
type CustomerService ¶
type CustomerService interface { ListCustomers(ctx context.Context, params ListCustomersInput) (pagination.PagedResponse[Customer], error) CreateCustomer(ctx context.Context, params CreateCustomerInput) (*Customer, error) DeleteCustomer(ctx context.Context, customer DeleteCustomerInput) error GetCustomer(ctx context.Context, customer GetCustomerInput) (*Customer, error) UpdateCustomer(ctx context.Context, params UpdateCustomerInput) (*Customer, error) }
type CustomerUsageAttribution ¶
type CustomerUsageAttribution struct {
SubjectKeys []string
}
CustomerUsageAttribution represents the usage attribution for a customer
type DeleteCustomerInput ¶
type DeleteCustomerInput CustomerID
DeleteCustomerInput represents the input for the DeleteCustomer method
type GetCustomerInput ¶
type GetCustomerInput CustomerID
GetCustomerInput represents the input for the GetCustomer method
type ListCustomersInput ¶
type ListCustomersInput struct { Namespace string pagination.Page IncludeDisabled bool }
ListCustomersInput represents the input for the ListCustomers method
type NotFoundError ¶
type NotFoundError struct {
CustomerID
}
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type Repository ¶
type Repository interface { CustomerRepository WithTx(context.Context) (TxRepository, error) }
type TxRepository ¶
type TxRepository interface { CustomerRepository Commit() error Rollback() error }
type UpdateAfterDeleteError ¶
type UpdateAfterDeleteError genericError
func (UpdateAfterDeleteError) Error ¶
func (e UpdateAfterDeleteError) Error() string
func (UpdateAfterDeleteError) Unwrap ¶
func (e UpdateAfterDeleteError) Unwrap() error
type UpdateCustomerInput ¶
UpdateCustomerInput represents the input for the UpdateCustomer method
type ValidationError ¶
type ValidationError genericError
func (ValidationError) Error ¶
func (e ValidationError) Error() string
func (ValidationError) Unwrap ¶
func (e ValidationError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.