Documentation
¶
Overview ¶
Package feature provides standalone, reusable feature definitions for the Ledger billing engine. Features can be global (AppID="") or scoped to a specific application, and multiple plans can reference the same catalog feature via plan.Feature.CatalogID.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Feature ¶
type Feature struct {
types.Entity
ID id.FeatureID `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
Type FeatureType `json:"type"`
DefaultLimit int64 `json:"default_limit"`
Period Period `json:"period"`
SoftLimit bool `json:"soft_limit"`
Status Status `json:"status"`
AppID string `json:"app_id"`
ProviderID string `json:"provider_id,omitempty"`
ProviderName string `json:"provider_name,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
Feature is a standalone, reusable feature definition in the catalog. Features can be global (AppID="") or scoped to a specific app. Multiple plans can reference the same catalog feature via plan.Feature.CatalogID.
type FeatureType ¶
type FeatureType string
FeatureType identifies how the feature is measured and enforced. Values mirror plan.FeatureType to ensure seamless mapping without circular imports (feature must not import plan).
const ( FeatureMetered FeatureType = "metered" FeatureBoolean FeatureType = "boolean" FeatureSeat FeatureType = "seat" )