mock

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 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 FailingMockProvider

type FailingMockProvider struct {
	*StaticMockProvider
}

FailingMockProvider defines a mocked exchange rate provider that always fails when fetching prices.

func NewFailingMockProvider

func NewFailingMockProvider() *FailingMockProvider

NewFailingMockProvider returns a new failing mock provider.

func (FailingMockProvider) GetPrices

GetPrices always fails for the failing mock provider.

func (FailingMockProvider) Name

func (p FailingMockProvider) Name() string

Name returns the name of the failing mock provider.

type StaticMockProvider

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

StaticMockProvider defines a mocked exchange rate provider using fixed exchange rates.

func NewStaticMockProvider

func NewStaticMockProvider() *StaticMockProvider

NewStaticMockProvider returns a new mock provider. The mock provider will always return the same static data. Meant to be used for testing.

func (StaticMockProvider) GetPairs

GetPairs is a no-op for the mock provider.

func (StaticMockProvider) GetPrices

GetPrices returns the mocked exchange rates.

func (StaticMockProvider) Name

func (p StaticMockProvider) Name() string

Name returns the name of the mock provider.

func (StaticMockProvider) SetPairs

func (p StaticMockProvider) SetPairs(_ ...oracletypes.CurrencyPair)

SetPairs is a no-op for the mock provider.

type TimeoutMockProvider

type TimeoutMockProvider struct {
	*StaticMockProvider
	// contains filtered or unexported fields
}

TimeoutMockProvider defines a mocked exchange rate provider that always times out when fetching prices.

func NewTimeoutMockProvider

func NewTimeoutMockProvider(timeout time.Duration) *TimeoutMockProvider

NewTimeoutMockProvider returns a new timeout mock provider.

func (TimeoutMockProvider) GetPrices

GetPrices always times out for the timeout mock provider.

func (TimeoutMockProvider) Name

func (p TimeoutMockProvider) Name() string

Name returns the name of the timeout mock provider.

Jump to

Keyboard shortcuts

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