mockoracle

package
Version: v2.0.11+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockOracle

type MockOracle struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MockOracle is a mock oracle for test.

func (*MockOracle) AddOffset

func (o *MockOracle) AddOffset(d time.Duration)

AddOffset adds the offset of the oracle.

func (*MockOracle) Close

func (o *MockOracle) Close()

Close implements oracle.Oracle interface.

func (*MockOracle) Disable

func (o *MockOracle) Disable()

Disable disables the Oracle

func (*MockOracle) Enable

func (o *MockOracle) Enable()

Enable enables the Oracle

func (*MockOracle) GetTimestamp

func (o *MockOracle) GetTimestamp(context.Context) (uint64, error)

GetTimestamp implements oracle.Oracle interface.

func (*MockOracle) GetTimestampAsync

func (o *MockOracle) GetTimestampAsync(ctx context.Context) oracle.Future

GetTimestampAsync implements oracle.Oracle interface.

func (*MockOracle) IsExpired

func (o *MockOracle) IsExpired(lockTimestamp uint64, TTL uint64) bool

IsExpired implements oracle.Oracle interface.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL