mockoracle

package
v2.1.0-rc.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 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.

Jump to

Keyboard shortcuts

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