Documentation
¶
Index ¶
- type Repo
- func (r *Repo) ChangeWorkspacePlan(ctx context.Context, workspaceID, toPlan, actor, reason string, now time.Time, ...) error
- func (r *Repo) CreateOrder(ctx context.Context, o domain.Order) (domain.Order, error)
- func (r *Repo) ExpireDueWorkspaces(ctx context.Context, now time.Time, limit int) ([]app.ExpiredWorkspace, error)
- func (r *Repo) FailOrder(ctx context.Context, o domain.Order, e domain.PaymentEvent, ...) error
- func (r *Repo) FindOrderByChannelRef(ctx context.Context, channel, channelRef string) (domain.Order, bool, error)
- func (r *Repo) FindOrderByPaymentIntent(ctx context.Context, paymentIntentRef string) (domain.Order, bool, error)
- func (r *Repo) FindWorkspaceBySubscription(ctx context.Context, subscriptionRef string) (string, string, bool, error)
- func (r *Repo) GetMeter(ctx context.Context, slug string) (app.Meter, bool, error)
- func (r *Repo) GetOrder(ctx context.Context, id string) (domain.Order, bool, error)
- func (r *Repo) GetPlan(ctx context.Context, code string) (domain.Plan, bool, error)
- func (r *Repo) GetWorkspacePlan(ctx context.Context, workspaceID string) (string, error)
- func (r *Repo) GetWorkspaceSubscription(ctx context.Context, workspaceID string) (string, bool, error)
- func (r *Repo) InsertOverageOrder(ctx context.Context, o domain.Order) (domain.Order, bool, error)
- func (r *Repo) InsertPaymentEvent(ctx context.Context, e domain.PaymentEvent) (bool, error)
- func (r *Repo) LatestPaidOrderInterval(ctx context.Context, workspaceID string) (string, bool, error)
- func (r *Repo) ListAllOrders(ctx context.Context, f app.AdminOrderFilter, limit, offset int) ([]app.AdminOrderView, int, error)
- func (r *Repo) ListMeteredWorkspaces(ctx context.Context, limit int) ([]app.MeteredWorkspace, error)
- func (r *Repo) ListMeters(ctx context.Context) ([]app.Meter, error)
- func (r *Repo) ListOrdersByWorkspace(ctx context.Context, workspaceID string, limit int) ([]domain.Order, error)
- func (r *Repo) ListPaymentEvents(ctx context.Context, f app.PaymentEventFilter, limit, offset int) ([]app.PaymentEventView, int, error)
- func (r *Repo) ListPlanCodes(ctx context.Context) ([]string, error)
- func (r *Repo) ListPlans(ctx context.Context) ([]domain.Plan, error)
- func (r *Repo) MarkEventError(ctx context.Context, channel, channelEventID, processErr string) error
- func (r *Repo) MarkEventProcessed(ctx context.Context, channel, channelEventID string) error
- func (r *Repo) PayOrder(ctx context.Context, id string, emit func(pgx.Tx) error, now time.Time) error
- func (r *Repo) RegisterMeter(ctx context.Context, m app.Meter) error
- func (r *Repo) SetOrderChannelRef(ctx context.Context, id, channelRef string) error
- func (r *Repo) SetOrderPaymentIntentRef(ctx context.Context, orderID, paymentIntentRef string) error
- func (r *Repo) SetWorkspaceSubscription(ctx context.Context, workspaceID, subscriptionRef string, ...) error
- func (r *Repo) UpdateOrderStatus(ctx context.Context, id string, from, to domain.OrderStatus, now time.Time) error
- func (r *Repo) UpdatePlan(ctx context.Context, code, name, limitsJSON string, sortNo int, ...) (found bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) ChangeWorkspacePlan ¶
func (*Repo) CreateOrder ¶
func (*Repo) ExpireDueWorkspaces ¶
func (*Repo) FindOrderByChannelRef ¶
func (*Repo) FindOrderByPaymentIntent ¶
func (*Repo) FindWorkspaceBySubscription ¶
func (*Repo) GetWorkspacePlan ¶
func (*Repo) GetWorkspaceSubscription ¶
func (*Repo) InsertOverageOrder ¶
func (*Repo) InsertPaymentEvent ¶
func (*Repo) LatestPaidOrderInterval ¶
func (*Repo) ListAllOrders ¶
func (r *Repo) ListAllOrders(ctx context.Context, f app.AdminOrderFilter, limit, offset int) ([]app.AdminOrderView, int, error)
func (*Repo) ListMeteredWorkspaces ¶
func (*Repo) ListOrdersByWorkspace ¶
func (*Repo) ListPaymentEvents ¶
func (r *Repo) ListPaymentEvents(ctx context.Context, f app.PaymentEventFilter, limit, offset int) ([]app.PaymentEventView, int, error)
func (*Repo) MarkEventError ¶
func (*Repo) MarkEventProcessed ¶
func (*Repo) SetOrderChannelRef ¶
func (*Repo) SetOrderPaymentIntentRef ¶
func (*Repo) SetWorkspaceSubscription ¶
func (*Repo) UpdateOrderStatus ¶
func (*Repo) UpdatePlan ¶ added in v0.8.0
func (r *Repo) UpdatePlan(ctx context.Context, code, name, limitsJSON string, sortNo int, currency string) (found bool, err error)
UpdatePlan full-replaces the editable columns of a plan (the code in the WHERE clause is the immutable identity). found reports whether a row matched; false means the caller turns it into a not-found error.
Click to show internal directories.
Click to hide internal directories.