Back to godoc.org

Package oracles

v0.0.0-...-e5f2e4b
Latest Go to latest

The highest tagged major version is .

Published: Jul 7, 2019 | License: Apache-2.0 | Module: github.com/daiguadaidai/tidb

Index

func NewLocalOracle

func NewLocalOracle() oracle.Oracle

NewLocalOracle creates an Oracle that uses local time as data source.

func NewPdOracle

func NewPdOracle(pdClient pd.Client, updateInterval time.Duration) (oracle.Oracle, error)

NewPdOracle create an Oracle that uses a pd client source. Refer https://github.com/pingcap/pd/blob/master/client/client.go for more details. PdOracle mantains `lastTS` to store the last timestamp got from PD server. If `GetTimestamp()` is not called after `updateInterval`, it will be called by itself to keep up with the timestamp on PD server.

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

Jump to identifier

Keyboard shortcuts

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