Documentation
¶
Overview ¶
Package cost computes actual and list-price equivalent USD costs for request log rows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Providers func(ctx context.Context) ([]store.Provider, error)
Billings func(ctx context.Context) ([]store.Billing, error)
Overrides func(ctx context.Context) ([]store.PriceOverride, error)
Catalog func() *prices.Catalog
Since time.Time
}
Deps supplies the read dependencies of a Pricer.
type Pricer ¶
type Pricer struct {
// contains filtered or unexported fields
}
Pricer turns engine log rows into store.RequestCost records without locks or I/O on the hot path.
func (*Pricer) Equivalent ¶
Equivalent resolves the list-price rates for a public provider and model, applying overrides and builtin type lookup.
func (*Pricer) Mode ¶
Mode returns the effective billing mode and optional monthly fee for provider.
func (*Pricer) Price ¶
func (p *Pricer) Price(row bifrost.Log) store.RequestCost
Price computes the actual and equivalent USD costs and states for a terminal engine log row.