mirror of
https://github.com/hanzoai/types.git
synced 2026-10-01 00:45:52 +00:00
A value belongs here when two or more services must agree on it exactly and neither should inherit the other's machinery to do so. The package imports the standard library only; go list -deps is 63, all stdlib. Seeded with the metered-series window. Cloud and ai must resolve ?range/?start/ ?end to the same [start, end) and the same bucket interval, and cloud reached that 30-line rule through a package that carries 1925 dependencies. Interval is a closed type. The bucket function is not bindable in the engines that serve these series, so the interval reaches a query by interpolation; ParseWindow yields Hour or Day and nothing else can be constructed through it. ParseWindow is total: it returns a window or an error, never a zero window a caller could read as a valid range. It also carries the resolved label, which every call site previously re-derived. Co-authored-by: Hanzo Dev <[email protected]>
10 lines
443 B
Go
10 lines
443 B
Go
// Package types holds the values Hanzo services share.
|
|
//
|
|
// It imports the standard library only, so a service can depend on a value
|
|
// without inheriting the machinery of whoever else uses it.
|
|
//
|
|
// A value earns a place here when two or more services must agree on it
|
|
// exactly. Fetching, storing and recording are effects, and an effect belongs
|
|
// with the service that owns it, next to the schema or transport it acts on.
|
|
package types
|