physical

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoosedPrecisionOracle

type LoosedPrecisionOracle struct {
	Oracle
	// contains filtered or unexported fields
}

func NewLoosedPrecisionOracle

func NewLoosedPrecisionOracle() *LoosedPrecisionOracle

This one is used for redis db because zset only has float64 as score type, if don't do this, can't handle precision lost....

func (*LoosedPrecisionOracle) FetchTimestamp

func (o *LoosedPrecisionOracle) FetchTimestamp(_ context.Context) (uint64, error)

type Oracle

type Oracle struct {
	sync.Mutex
}

func NewOracle

func NewOracle() *Oracle

func (*Oracle) Close

func (o *Oracle) Close() error

func (*Oracle) FetchTimestamp

func (o *Oracle) FetchTimestamp(_ context.Context) (uint64, error)

func (*Oracle) IsTooOld

func (o *Oracle) IsTooOld(ts uint64, maxAge time.Duration) bool

func (*Oracle) MustFetchTimestamp

func (o *Oracle) MustFetchTimestamp() uint64

Jump to

Keyboard shortcuts

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