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()
Click to show internal directories.
Click to hide internal directories.