Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreditPool ¶ added in v1.9.1
type CreditPool struct {
Key string `json:"key"`
Amount types.Money `json:"amount"`
FeatureKeys []string `json:"feature_keys"`
}
CreditPool is an amount of usage credit a plan includes each billing period. It is spent against the metered features named in FeatureKeys, and a feature belongs to at most one pool on a plan.
type Feature ¶
type Feature struct {
types.Entity
ID id.FeatureID `json:"id"`
CatalogID id.FeatureID `json:"catalog_id,omitempty"` // links to standalone catalog feature
Key string `json:"key"`
Name string `json:"name"`
Type FeatureType `json:"type"`
Limit int64 `json:"limit"`
Period Period `json:"period"`
SoftLimit bool `json:"soft_limit"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type FeatureType ¶
type FeatureType string
const ( FeatureMetered FeatureType = "metered" FeatureBoolean FeatureType = "boolean" FeatureSeat FeatureType = "seat" )
type Plan ¶
type Plan struct {
types.Entity
ID id.PlanID `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Currency string `json:"currency"`
Status Status `json:"status"`
TrialDays int `json:"trial_days"`
Features []Feature `json:"features"`
Pricing *Pricing `json:"pricing,omitempty"`
Credits []CreditPool `json:"credits,omitempty"`
AppID string `json:"app_id"`
ProviderID string `json:"provider_id,omitempty"`
ProviderName string `json:"provider_name,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
func (*Plan) FindFeature ¶
type Store ¶
type Store interface {
Create(ctx context.Context, p *Plan) error
Get(ctx context.Context, planID id.PlanID) (*Plan, error)
GetBySlug(ctx context.Context, slug string, appID string) (*Plan, error)
List(ctx context.Context, appID string, opts ListOpts) ([]*Plan, error)
Update(ctx context.Context, p *Plan) error
Delete(ctx context.Context, planID id.PlanID) error
Archive(ctx context.Context, planID id.PlanID) error
}
Click to show internal directories.
Click to hide internal directories.