cost

package
v1.0.0-beta.228 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL