Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
QueryFeatureCost(ctx context.Context, input QueryFeatureCostInput) (*CostQueryResult, error)
}
Adapter provides the data access layer for cost computation.
type CostQueryResult ¶
type CostQueryResult struct {
Currency currencyx.Code
Rows []CostQueryRow
}
CostQueryResult is the result of querying feature costs.
type CostQueryRow ¶
type CostQueryRow struct {
Usage alpacadecimal.Decimal
Cost *alpacadecimal.Decimal
Currency currencyx.Code
Detail string
Subject *string
CustomerID *string
GroupBy map[string]*string
WindowStart time.Time
WindowEnd time.Time
}
CostQueryRow represents a single row in a feature cost query result.
type QueryFeatureCostInput ¶
type QueryFeatureCostInput struct {
Namespace string
FeatureID string
QueryParams streaming.QueryParams
}
QueryFeatureCostInput is the input for querying the cost of a feature.
func (QueryFeatureCostInput) Validate ¶
func (i QueryFeatureCostInput) Validate() error
type ResolvedUnitCost ¶
type ResolvedUnitCost struct {
// Amount is the resolved per-unit cost.
Amount alpacadecimal.Decimal
// Currency is the currency code (always "USD" for now).
Currency currencyx.Code
}
ResolvedUnitCost is the result of resolving a feature's per-unit cost.
type Service ¶
type Service interface {
QueryFeatureCost(ctx context.Context, input QueryFeatureCostInput) (*CostQueryResult, error)
}
Service provides cost computation for features.
Click to show internal directories.
Click to hide internal directories.