package epoch
import "github.com/containerd/containerd/pkg/epoch"
Package epoch provides SOURCE_DATE_EPOCH utilities.
Index ¶
- Constants
- func FromContext(ctx context.Context) *time.Time
- func SetSourceDateEpoch(tm time.Time)
- func SourceDateEpoch() (*time.Time, error)
- func SourceDateEpochOrNow() time.Time
- func UnsetSourceDateEpoch()
- func WithSourceDateEpoch(ctx context.Context, tm *time.Time) context.Context
Constants ¶
const SourceDateEpochEnv = "SOURCE_DATE_EPOCH"
SourceDateEpochEnv is the SOURCE_DATE_EPOCH env var. See https://reproducible-builds.org/docs/source-date-epoch/
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.
func WithSourceDateEpoch ¶
WithSourceDateEpoch associates the context with the epoch.
Source Files ¶
- Version
- v1.7.0
- Published
- Mar 10, 2023
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 1 hour ago –
Tools for package owners.