redis

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

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(args map[string]string) (*Client, error)

func (*Client) AddAcceptedShare

func (c *Client) AddAcceptedShare(
	chain, interval, compoundID string,
	soloMinerID uint64,
	count int,
	window int64,
) error

func (*Client) AddInterval

func (c *Client) AddInterval(chain, interval string) error

func (*Client) AddInvalidShare

func (c *Client) AddInvalidShare(
	chain, interval, compoundID string,
	soloMinerID uint64,
	count int,
) error

func (*Client) AddMinerIPAddressesInactive

func (c *Client) AddMinerIPAddressesInactive(chain string, values []string) error

func (*Client) AddRejectedShare

func (c *Client) AddRejectedShare(
	chain, interval, compoundID string,
	soloMinerID uint64,
	count int,
) error

func (*Client) AddShareIndexHeight

func (c *Client) AddShareIndexHeight(chain string, height uint64) error

func (*Client) AddUniqueShare

func (c *Client) AddUniqueShare(chain string, height uint64, hash string) (bool, error)

func (*Client) DeleteInterval

func (c *Client) DeleteInterval(chain, interval string) error

func (*Client) DeleteShareIndexHeight

func (c *Client) DeleteShareIndexHeight(chain string, height uint64) error

func (*Client) GetCachedGlobalLastProfits

func (c *Client) GetCachedGlobalLastProfits() ([]*tsdb.Block, error)

func (*Client) GetCachedGlobalLastShares

func (c *Client) GetCachedGlobalLastShares() ([]*tsdb.Share, error)

func (*Client) GetCachedLuckByChain

func (c *Client) GetCachedLuckByChain(chain string) (float64, error)

func (*Client) GetCachedMinersByChain

func (c *Client) GetCachedMinersByChain(chain string) (int64, error)

func (*Client) GetCachedWorkersByChain

func (c *Client) GetCachedWorkersByChain(chain string) (int64, error)

func (*Client) GetChartBlocksLastTime

func (c *Client) GetChartBlocksLastTime(chain string) (time.Time, error)

func (*Client) GetChartEarningsLastTime

func (c *Client) GetChartEarningsLastTime(chain string) (time.Time, error)

func (*Client) GetChartRoundsLastTime

func (c *Client) GetChartRoundsLastTime(chain string) (time.Time, error)

func (*Client) GetChartSharesLastTime

func (c *Client) GetChartSharesLastTime(chain string) (time.Time, error)

func (*Client) GetIntervalAcceptedShares

func (c *Client) GetIntervalAcceptedShares(chain, interval string) (
	map[string]uint64,
	map[string]uint64,
	error,
)

func (*Client) GetIntervalInvalidShares

func (c *Client) GetIntervalInvalidShares(chain, interval string) (
	map[string]uint64,
	map[string]uint64,
	error,
)

func (*Client) GetIntervalRejectedShares

func (c *Client) GetIntervalRejectedShares(chain, interval string) (
	map[string]uint64,
	map[string]uint64,
	error,
)

func (*Client) GetIntervals

func (c *Client) GetIntervals(chain string) ([]string, error)

func (*Client) GetMinerDifficulties

func (c *Client) GetMinerDifficulties(chain string) (map[string]float64, error)

func (*Client) GetMinerID

func (c *Client) GetMinerID(miner string) (uint64, error)

func (*Client) GetMinerIPAddresses

func (c *Client) GetMinerIPAddresses(chain string) (map[string]float64, error)

func (*Client) GetMinerIPAddressesInactive

func (c *Client) GetMinerIPAddressesInactive(chain string) (map[string]bool, error)

func (*Client) GetMinerLatencies

func (c *Client) GetMinerLatencies(chain string) (map[string]float64, error)

func (*Client) GetRoundShareCounts

func (c *Client) GetRoundShareCounts(chain string, soloMinerID uint64) (
	uint64, uint64, uint64,
	error,
)

func (*Client) GetRoundShares

func (c *Client) GetRoundShares(chain string) (map[uint64]uint64, error)

func (*Client) GetRoundSoloShares

func (c *Client) GetRoundSoloShares(chain string, minerID uint64) (uint64, error)

func (*Client) GetShareIndexes

func (c *Client) GetShareIndexes(chain string) ([]string, error)

func (*Client) GetStreamDebugIndexChannel

func (c *Client) GetStreamDebugIndexChannel() (*PubSub, error)

func (*Client) GetStreamMinerChannel

func (c *Client) GetStreamMinerChannel(minerID uint64) (*PubSub, error)

func (*Client) GetStreamMinerIndexChannel

func (c *Client) GetStreamMinerIndexChannel() (*PubSub, error)

func (*Client) GetTopMinerIDs

func (c *Client) GetTopMinerIDs(chain string) ([]uint64, error)

func (*Client) GetWorkerID

func (c *Client) GetWorkerID(minerID uint64, worker string) (uint64, error)

func (*Client) NewLocker

func (c *Client) NewLocker() *redislock.Client

func (*Client) NewRateLimiter

func (c *Client) NewRateLimiter() *redis_rate.Limiter

func (*Client) Ping

func (c *Client) Ping() error

func (*Client) RemoveMinerIPAddresses

func (c *Client) RemoveMinerIPAddresses(chain string, values []string) error

func (*Client) RemoveMinerIPAddressesInactive

func (c *Client) RemoveMinerIPAddressesInactive(chain string, values []string) error

func (*Client) SetCachedGlobalLastProfits

func (c *Client) SetCachedGlobalLastProfits(blocks []*tsdb.Block, exp time.Duration) error

func (*Client) SetCachedGlobalLastShares

func (c *Client) SetCachedGlobalLastShares(shares []*tsdb.Share, exp time.Duration) error

func (*Client) SetCachedLuckByChain

func (c *Client) SetCachedLuckByChain(chain string, luck float64, exp time.Duration) error

func (*Client) SetCachedMinersByChain

func (c *Client) SetCachedMinersByChain(chain string, miners int64, exp time.Duration) error

func (*Client) SetCachedWorkersByChain

func (c *Client) SetCachedWorkersByChain(chain string, workers int64, exp time.Duration) error

func (*Client) SetChartBlocksLastTime

func (c *Client) SetChartBlocksLastTime(chain string, timestamp time.Time) error

func (*Client) SetChartEarningsLastTime

func (c *Client) SetChartEarningsLastTime(chain string, timestamp time.Time) error

func (*Client) SetChartRoundsLastTime

func (c *Client) SetChartRoundsLastTime(chain string, timestamp time.Time) error

func (*Client) SetChartSharesLastTime

func (c *Client) SetChartSharesLastTime(chain string, timestamp time.Time) error

func (*Client) SetMinerDifficultiesBulk

func (c *Client) SetMinerDifficultiesBulk(chain string, values map[string]int64) error

func (*Client) SetMinerID

func (c *Client) SetMinerID(miner string, minerID uint64) error

func (*Client) SetMinerIPAddressesBulk

func (c *Client) SetMinerIPAddressesBulk(chain string, values map[string]int64) error

func (*Client) SetMinerLatenciesBulk

func (c *Client) SetMinerLatenciesBulk(chain string, values map[string]int64) error

func (*Client) SetTopMinerIDsBulk

func (c *Client) SetTopMinerIDsBulk(chain string, values map[uint64]float64, increment bool) error

func (*Client) SetWorkerID

func (c *Client) SetWorkerID(minerID uint64, worker string, workerID uint64) error

func (*Client) WriteToStreamDebugChannel

func (c *Client) WriteToStreamDebugChannel(ip, msg string) error

func (*Client) WriteToStreamDebugIndexChannel

func (c *Client) WriteToStreamDebugIndexChannel(msg string) error

func (*Client) WriteToStreamMinerChannel

func (c *Client) WriteToStreamMinerChannel(minerID uint64, msg string) error

func (*Client) WriteToStreamMinerIndexChannel

func (c *Client) WriteToStreamMinerIndexChannel(msg string) error

type PubSub

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

func (*PubSub) Channel

func (p *PubSub) Channel() <-chan *redis.Message

func (*PubSub) Close

func (p *PubSub) Close()

Jump to

Keyboard shortcuts

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