price

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriceService

type PriceService struct {
	cmn.BaseService
	// contains filtered or unexported fields
}

Price service fetches the sources periodically.

func NewPriceService

func NewPriceService() *PriceService

func (PriceService) GetPrice

func (ps PriceService) GetPrice(base string, quote string) (sdk.Dec, uint64, error)

Return pair price, but if it doesn't exist, return reverse pair price.

func (PriceService) GetPriceExact

func (ps PriceService) GetPriceExact(base string, quote string) (sdk.Dec, uint64, error)

Return exact base/quote pair price.

func (PriceService) OnStart

func (ps PriceService) OnStart() error

func (PriceService) PushSourceMeta

func (ps PriceService) PushSourceMeta(sourceMeta SourceMeta)

type SourceManager

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

func NewSourceManager

func NewSourceManager() *SourceManager

func (*SourceManager) GetSourceMeta

func (manager *SourceManager) GetSourceMeta(pair string, name string, interval time.Duration, weight uint64) SourceMeta

func (*SourceManager) Register

func (manager *SourceManager) Register(pair string, name string, provider types.SourceProvider)

type SourceMeta

type SourceMeta struct {
	Source types.Source
	Weight uint64
	// contains filtered or unexported fields
}

func (*SourceMeta) Fetch

func (meta *SourceMeta) Fetch(logger log.Logger)

type SourceMetaSet

type SourceMetaSet []*SourceMeta

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