Documentation ¶
Index ¶
Constants ¶
View Source
const LoggerTag = "ASYNC_GOFER"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncGofer ¶
type AsyncGofer struct { *Gofer // contains filtered or unexported fields }
AsyncGofer implements the gofer.Gofer interface. It works just like Gofer but allows updating prices asynchronously.
func NewAsyncGofer ¶
func NewAsyncGofer( graph map[gofer.Pair]nodes.Aggregator, feeder *feeder.Feeder, nodes []nodes.Node, logger log.Logger, ) (*AsyncGofer, error)
NewAsyncGofer returns a new AsyncGofer instance.
func (*AsyncGofer) Start ¶
func (a *AsyncGofer) Start(ctx context.Context) error
Start starts asynchronous price updater.
func (*AsyncGofer) Wait ¶
func (a *AsyncGofer) Wait() chan error
Wait waits until the context is canceled or until an error occurs.
type ErrPairNotFound ¶
func (ErrPairNotFound) Error ¶
func (e ErrPairNotFound) Error() string
type Gofer ¶
type Gofer struct {
// contains filtered or unexported fields
}
Gofer implements the gofer.Gofer interface. It uses a graph structure to calculate pairs prices.
func NewGofer ¶
NewGofer returns a new Gofer instance. If the Feeder is not nil, then prices are automatically updated when the Price or Prices methods are called. Otherwise, prices have to be updated externally.
Click to show internal directories.
Click to hide internal directories.