costintel

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CostAlert

type CostAlert struct {
	ID       string  `json:"id"`
	Type     string  `json:"type"`
	Message  string  `json:"message"`
	Severity int     `json:"severity"`
	USD      float64 `json:"usd"`
}

type CostIntelligence

type CostIntelligence struct {
	// contains filtered or unexported fields
}

func NewCostIntelligence

func NewCostIntelligence() *CostIntelligence

func (*CostIntelligence) ExportCSV

func (c *CostIntelligence) ExportCSV() string

func (*CostIntelligence) Forecast

func (c *CostIntelligence) Forecast(dailyRate float64) *SpendForecast

func (*CostIntelligence) GetAnomalies

func (c *CostIntelligence) GetAnomalies() []CostAlert

func (*CostIntelligence) GetBudgetStatus

func (c *CostIntelligence) GetBudgetStatus(budgetUSD, spentUSD float64) (bool, float64, string)

func (*CostIntelligence) GetTags

func (c *CostIntelligence) GetTags() []*CostTag

func (*CostIntelligence) RecordCost

func (c *CostIntelligence) RecordCost(tag, source string, usd float64)

type CostTag

type CostTag struct {
	Name   string  `json:"name"`
	Source string  `json:"source"`
	Total  float64 `json:"total"`
}

type SpendForecast

type SpendForecast struct {
	DailyUSD   float64 `json:"daily_usd"`
	WeeklyUSD  float64 `json:"weekly_usd"`
	MonthlyUSD float64 `json:"monthly_usd"`
	YearlyUSD  float64 `json:"yearly_usd"`
	Trend      string  `json:"trend"`
	Confidence float64 `json:"confidence"`
}

type WeeklyDigest

type WeeklyDigest struct {
	WeekStart       time.Time `json:"week_start"`
	WeekEnd         time.Time `json:"week_end"`
	TotalCost       float64   `json:"total_cost"`
	TotalTokens     int64     `json:"total_tokens"`
	TopModel        string    `json:"top_model"`
	TopCommand      string    `json:"top_command"`
	SavingsPct      float64   `json:"savings_pct"`
	Recommendations []string  `json:"recommendations"`
}

func GenerateWeeklyDigest

func GenerateWeeklyDigest(costs map[string]float64, tokens int64) *WeeklyDigest

Jump to

Keyboard shortcuts

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