Documentation ¶
Overview ¶
Package epoch provides SOURCE_DATE_EPOCH utilities.
Index ¶
Constants ¶
const SourceDateEpochEnv = "SOURCE_DATE_EPOCH"
SourceDateEpochEnv is the SOURCE_DATE_EPOCH env var. See https://reproducible-builds.org/docs/source-date-epoch/
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns the epoch associated with the context. FromContext does not fall back to read the SOURCE_DATE_EPOCH env var.
func SetSourceDateEpoch ¶
SetSourceDateEpoch sets the SOURCE_DATE_EPOCH env var.
func SourceDateEpoch ¶
SourceDateEpoch returns the SOURCE_DATE_EPOCH env var as *time.Time. If the env var is not set, SourceDateEpoch returns nil without an error.
func SourceDateEpochOrNow ¶
SourceDateEpochOrNow returns the SOURCE_DATE_EPOCH time if available, otherwise returns the current time.
func UnsetSourceDateEpoch ¶
func UnsetSourceDateEpoch()
UnsetSourceDateEpoch unsets the SOURCE_DATE_EPOCH env var.
Types ¶
This section is empty.