epochtime

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: AGPL-3.0 Imports: 1 Imported by: 17

Documentation

Overview

Package epochtime implements Katzenpost epoch related timekeeping functions.

Index

Constants

This section is empty.

Variables

View Source
var Epoch = time.Date(2017, 6, 1, 0, 0, 0, 0, time.UTC)

Epoch is the Katzenpost epoch expressed in UTC.

View Source
var Period = 20 * time.Minute

Period is the duration of a Katzenpost epoch.

View Source
var WarpedEpoch string

WarpedEpoch is a flag that can be passed at build time to set the epoch Period

Functions

func FromUnix

func FromUnix(t int64) (current uint64, elapsed, till time.Duration)

FromUnix returns the Katzenpost epoch, time since the start of the current epoch, and time till the next epoch relative to a Unix time in seconds.

func IsInEpoch

func IsInEpoch(e uint64, t uint64) bool

IsInEpoch returns true iff the epoch e contains the time t, measured in the number of seconds since the UNIX epoch.

func Now

func Now() (current uint64, elapsed, till time.Duration)

Now returns the current Katzenpost epoch, time since the start of the current epoch, and time till the next epoch.

Types

This section is empty.

Jump to

Keyboard shortcuts

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