seededclock

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(times ...time.Time) *seededClock

New constructs a seeded clock.

Example (WithSeed)
package main

import (
	"fmt"
	"time"

	"github.com/inklabs/rangedb/pkg/clock/provider/seededclock"
)

func main() {
	// Given
	clock := seededclock.New(
		time.Unix(1576828800, 0),
		time.Unix(1579507200, 0),
	)

	// When
	fmt.Println(clock.Now().Unix())
	fmt.Println(clock.Now().Unix())

}
Output:

1576828800
1579507200

Types

This section is empty.

Jump to

Keyboard shortcuts

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