validtime

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guard

type Guard struct {
	Floor time.Time     // inclusive lower bound (default 2000-01-01T00:00:00Z)
	Skew  time.Duration // future tolerance above now (default 5m)
}

Guard bounds a document's claimed timestamp before it may become valid time (§2.4): earlier than Floor, or later than now+Skew, is rejected.

func Default

func Default() Guard

Default is the guard the CLI and pipeline use when unconfigured.

func (Guard) Resolve

func (g Guard) Resolve(t *time.Time, now time.Time) (time.Time, bool)

Resolve maps an optional native assertion timestamp to a valid_from under the guard. It returns the resolved UTC time and whether it fell back to now. A nil t, a t before Floor, or a t after now+Skew all fall back to now (fallback=true). now is assumed UTC (the shell passes time.Now().UTC()).

verbatim exception — the exact boundary logic IS the design decision.

Jump to

Keyboard shortcuts

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