Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init must be called before anything, otherwise a panic may occur.
It needs two mandatory arguments: an origin timestamp and a non-null period span (both in milliseconds), and an optional argument (passing it `true` if this is a test environment). It may throw an `AlreadyInitializedError` because the period module can't be initialized twice.
func IsTestEnvironment ¶
func IsTestEnvironment() bool
func ResetOriginTimestamp ¶ added in v1.0.2
func ResetOriginTimestamp(newTimestamp uint64)
ResetOriginTimestamp allows to force a new setting of the begin of the time. NB: Use with caution as all previous calculations might go wrong.
func SetTestEnvironment ¶ added in v1.0.1
Types ¶
type AlreadyInitializedError ¶ added in v1.0.1
type AlreadyInitializedError struct {
// contains filtered or unexported fields
}
AlreadyInitializedError ...
func NewAlreadyInitializedError ¶ added in v1.0.1
func NewAlreadyInitializedError() *AlreadyInitializedError
NewAlreadyInitializedError ...
func (*AlreadyInitializedError) Error ¶ added in v1.0.1
func (e *AlreadyInitializedError) Error() string
type Period ¶
type Period struct {
ID uint64
// contains filtered or unexported fields
}
Period ...
func (*Period) EndTimestampMillis ¶
EndTimestampMillis ...
func (*Period) StartTimestampMillis ¶
StartTimestampMillis ...
Click to show internal directories.
Click to hide internal directories.