pdtime

package
v0.0.0-...-a345a4b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeAcquirer

type TimeAcquirer interface {
	// Run run the TimeAcquirer
	Run(ctx context.Context)
	// CurrentTimeFromCached returns current time from cache
	CurrentTimeFromCached() (time.Time, error)
	// Stop stops the TimeAcquirer
	Stop()
}

func NewTimeAcquirer

func NewTimeAcquirer(pdClient pd.Client) TimeAcquirer

NewTimeAcquirer return a new TimeAcquirer

func NewTimeAcquirer4Test

func NewTimeAcquirer4Test() TimeAcquirer

type TimeAcquirer4Test

type TimeAcquirer4Test struct{}

func (*TimeAcquirer4Test) CurrentTimeFromCached

func (c *TimeAcquirer4Test) CurrentTimeFromCached() (time.Time, error)

func (*TimeAcquirer4Test) Run

func (c *TimeAcquirer4Test) Run(ctx context.Context)

func (*TimeAcquirer4Test) Stop

func (c *TimeAcquirer4Test) Stop()

type TimeAcquirerImpl

type TimeAcquirerImpl struct {
	// contains filtered or unexported fields
}

TimeAcquirerImpl cache time get from PD periodically and cache it

func (*TimeAcquirerImpl) CurrentTimeFromCached

func (c *TimeAcquirerImpl) CurrentTimeFromCached() (time.Time, error)

CurrentTimeFromCached return current time from pd cache

func (*TimeAcquirerImpl) Run

func (c *TimeAcquirerImpl) Run(ctx context.Context)

Run will get time from pd periodically to cache in pdPhysicalTimeCache

func (*TimeAcquirerImpl) Stop

func (c *TimeAcquirerImpl) Stop()

Jump to

Keyboard shortcuts

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