pricing

package
v0.0.0-...-5f4d607 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

func NewChecker

func NewChecker(notifier notifying.Service, feed Feed, triggers []*notifying.Trigger) *Checker

TODO: pass Storage interface instead of triggers.

func (*Checker) Run

func (p *Checker) Run()

Run starts the Checker, it pulls the latest prices, checks them against active Triggers. Send alert when case is met. Disable Trigger, and remove from list.

func (*Checker) Stop

func (n *Checker) Stop() error

Close closes the feed, then sends a chan error to the closing channel, and waits to return the last error, if any.

type Feed

type Feed interface {
	Updates() <-chan Message
	Close() error
}

Feed delivers Messages over a channel, Close cancels the feed, closes the Updates channel, and returns the last error, if any.

func NewCoinbaseFeed

func NewCoinbaseFeed(currency string, symbols ...string) (Feed, error)

NewCoinbaseFeed creates a new CoinBase WebSocket feed for the given currency and cryptos.

type JSON

type JSON map[string]interface{}

type Message

type Message struct {
	Type      string           `json:"type"`
	ProductId string           `json:"product_id"`
	Channels  []MessageChannel `json:"channels"`
	Price     string           `json:"price"`
}

type MessageChannel

type MessageChannel struct {
	Name       string   `json:"name"`
	ProductIds []string `json:"product_ids"`
}

Jump to

Keyboard shortcuts

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