Back to

Package oracle

Latest Go to latest

The latest major version is .

Published: Apr 20, 2018 | License: Apache-2.0 | Module:


func ComposeTS

func ComposeTS(physical, logical int64) uint64

ComposeTS creates a ts from physical and logical parts.

func ExtractPhysical

func ExtractPhysical(ts uint64) int64

ExtractPhysical returns a ts's physical part.

func GetPhysical

func GetPhysical(t time.Time) int64

GetPhysical returns physical from an instant time with millisecond precision.

type Future

type Future interface {
	Wait() (uint64, error)

Future is a future which promises to return a timestamp.

type Oracle

type Oracle interface {
	GetTimestamp(ctx goctx.Context) (uint64, error)
	GetTimestampAsync(ctx goctx.Context) Future
	IsExpired(lockTimestamp uint64, TTL uint64) bool

Oracle is the interface that provides strictly ascending timestamps.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier