Documentation
¶
Overview ¶
Package server is the ingest service behind costroid serve: the result-stream and OTLP paths, pricing against the pinned catalog, and the per-PR view.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EgressMain ¶
EgressMain runs costroid egress and returns an exit code.
Types ¶
type Config ¶
type Config struct {
Ledger Ledger
Verifier TokenVerifier
Catalog *catalog.Catalog
// PseudonymKey is the master key the per-tenant HMAC keys derive from.
PseudonymKey []byte
Now func() time.Time
Logger *slog.Logger
}
Config wires a Server.
type Ledger ¶
type Ledger interface {
TenantForOwner(ctx context.Context, host, owner string) (store.TenantID, error)
TenantForKey(ctx context.Context, keySHA256 string) (store.TenantID, error)
Ingest(ctx context.Context, tenant store.TenantID, batch store.Batch) (store.Receipt, error)
PullRequest(ctx context.Context, tenant store.TenantID, repo, pr string) ([]store.Line, error)
}
Ledger is what the service needs from the store.