Documentation ¶
Index ¶
- Constants
- Variables
- type Biller
- type Orb
- func (o *Orb) CancelSubscription(ctx context.Context, subscriptionID string, ...) error
- func (o *Orb) CancelSubscriptionsForCustomer(ctx context.Context, customerID string, ...) error
- func (o *Orb) ChangeSubscriptionPlan(ctx context.Context, subscriptionID string, plan *Plan) (*Subscription, error)
- func (o *Orb) CreateCustomer(ctx context.Context, organization *database.Organization) (string, error)
- func (o *Orb) CreateSubscription(ctx context.Context, customerID string, plan *Plan) (*Subscription, error)
- func (o *Orb) GetDefaultPlan(ctx context.Context) (*Plan, error)
- func (o *Orb) GetPlan(ctx context.Context, id string) (*Plan, error)
- func (o *Orb) GetPlanByName(ctx context.Context, name string) (*Plan, error)
- func (o *Orb) GetPlans(ctx context.Context) ([]*Plan, error)
- func (o *Orb) GetPublicPlans(ctx context.Context) ([]*Plan, error)
- func (o *Orb) GetReportingGranularity() UsageReportingGranularity
- func (o *Orb) GetReportingWorkerCron() string
- func (o *Orb) GetSubscriptionsForCustomer(ctx context.Context, customerID string) ([]*Subscription, error)
- func (o *Orb) Name() string
- func (o *Orb) ReportUsage(ctx context.Context, usage []*Usage) error
- type Plan
- type Quotas
- type Subscription
- type SubscriptionCancellationOption
- type Usage
- type UsageReportingGranularity
Constants ¶
View Source
const ( SupportEmail = "support@rilldata.com" DefaultTimeZone = "UTC" )
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Biller ¶
type Biller interface { Name() string GetDefaultPlan(ctx context.Context) (*Plan, error) GetPlans(ctx context.Context) ([]*Plan, error) // GetPublicPlans for listing purposes GetPublicPlans(ctx context.Context) ([]*Plan, error) // GetPlan returns the plan with the given biller plan ID. GetPlan(ctx context.Context, id string) (*Plan, error) // GetPlanByName returns the plan with the given Rill plan name. GetPlanByName(ctx context.Context, name string) (*Plan, error) // CreateCustomer creates a customer for the given organization in the billing system and returns the external customer ID. CreateCustomer(ctx context.Context, organization *database.Organization) (string, error) // CreateSubscription creates a subscription for the given organization. // The subscription starts immediately. CreateSubscription(ctx context.Context, customerID string, plan *Plan) (*Subscription, error) CancelSubscription(ctx context.Context, subscriptionID string, cancelOption SubscriptionCancellationOption) error GetSubscriptionsForCustomer(ctx context.Context, customerID string) ([]*Subscription, error) ChangeSubscriptionPlan(ctx context.Context, subscriptionID string, plan *Plan) (*Subscription, error) // CancelSubscriptionsForCustomer deletes the subscription for the given organization. // cancellationDate only applicable if option is SubscriptionCancellationOptionRequestedDate CancelSubscriptionsForCustomer(ctx context.Context, customerID string, cancelOption SubscriptionCancellationOption) error ReportUsage(ctx context.Context, usage []*Usage) error GetReportingGranularity() UsageReportingGranularity GetReportingWorkerCron() string }
type Orb ¶
type Orb struct {
// contains filtered or unexported fields
}
func (*Orb) CancelSubscription ¶
func (*Orb) CancelSubscriptionsForCustomer ¶
func (*Orb) ChangeSubscriptionPlan ¶
func (*Orb) CreateCustomer ¶
func (*Orb) CreateSubscription ¶
func (*Orb) GetPlanByName ¶
func (*Orb) GetReportingGranularity ¶
func (o *Orb) GetReportingGranularity() UsageReportingGranularity
func (*Orb) GetReportingWorkerCron ¶
func (*Orb) GetSubscriptionsForCustomer ¶
type Subscription ¶
type SubscriptionCancellationOption ¶
type SubscriptionCancellationOption int
const ( SubscriptionCancellationOptionEndOfSubscriptionTerm SubscriptionCancellationOption = iota SubscriptionCancellationOptionImmediate )
type UsageReportingGranularity ¶
type UsageReportingGranularity string
const ( UsageReportingGranularityNone UsageReportingGranularity = "" UsageReportingGranularityHour UsageReportingGranularity = "hour" )
Click to show internal directories.
Click to hide internal directories.