Documentation
¶
Index ¶
- type AgentSpend
- type ModelSpend
- type PostgresStore
- func (s *PostgresStore) GetSpendByAgent(ctx context.Context, from, to time.Time) ([]AgentSpend, error)
- func (s *PostgresStore) GetSpendByModel(ctx context.Context, from, to time.Time) ([]ModelSpend, error)
- func (s *PostgresStore) GetSpendByProject(ctx context.Context, from, to time.Time) ([]ProjectSpend, error)
- func (s *PostgresStore) GetSpendByProvider(ctx context.Context, from, to time.Time) ([]ProviderSpend, error)
- func (s *PostgresStore) GetSpendByTeam(ctx context.Context, from, to time.Time) ([]TeamSpend, error)
- func (s *PostgresStore) GetSpendForAgent(ctx context.Context, agent string, from, to time.Time) (float64, error)
- func (s *PostgresStore) GetSpendForProject(ctx context.Context, project string, from, to time.Time) (float64, error)
- func (s *PostgresStore) GetSpendForTeam(ctx context.Context, team string, from, to time.Time) (float64, error)
- func (s *PostgresStore) GetTotalSpend(ctx context.Context, from, to time.Time) (float64, error)
- func (s *PostgresStore) Save(ctx context.Context, r Record) error
- type ProjectSpend
- type ProviderSpend
- type Record
- type Store
- type Summary
- type TeamSpend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentSpend ¶
type ModelSpend ¶
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewPostgresStore(db *pgxpool.Pool) *PostgresStore
func (*PostgresStore) GetSpendByAgent ¶
func (s *PostgresStore) GetSpendByAgent(ctx context.Context, from, to time.Time) ([]AgentSpend, error)
func (*PostgresStore) GetSpendByModel ¶
func (s *PostgresStore) GetSpendByModel(ctx context.Context, from, to time.Time) ([]ModelSpend, error)
func (*PostgresStore) GetSpendByProject ¶
func (s *PostgresStore) GetSpendByProject(ctx context.Context, from, to time.Time) ([]ProjectSpend, error)
func (*PostgresStore) GetSpendByProvider ¶
func (s *PostgresStore) GetSpendByProvider(ctx context.Context, from, to time.Time) ([]ProviderSpend, error)
func (*PostgresStore) GetSpendByTeam ¶
func (*PostgresStore) GetSpendForAgent ¶
func (*PostgresStore) GetSpendForProject ¶
func (*PostgresStore) GetSpendForTeam ¶
func (*PostgresStore) GetTotalSpend ¶
type ProjectSpend ¶
type ProviderSpend ¶
type Store ¶
type Store interface {
Save(ctx context.Context, record Record) error
GetTotalSpend(ctx context.Context, from, to time.Time) (float64, error)
GetSpendByTeam(ctx context.Context, from, to time.Time) ([]TeamSpend, error)
GetSpendByProvider(ctx context.Context, from, to time.Time) ([]ProviderSpend, error)
GetSpendByModel(ctx context.Context, from, to time.Time) ([]ModelSpend, error)
GetSpendByProject(ctx context.Context, from, to time.Time) ([]ProjectSpend, error)
GetSpendForTeam(ctx context.Context, team string, from, to time.Time) (float64, error)
GetSpendForProject(ctx context.Context, project string, from, to time.Time) (float64, error)
GetSpendForAgent(ctx context.Context, agent string, from, to time.Time) (float64, error)
GetSpendByAgent(ctx context.Context, from, to time.Time) ([]AgentSpend, error)
}
Click to show internal directories.
Click to hide internal directories.