channelchecker

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 17 Imported by: 0

README

Channelchecker

Channelchecker is an abstraction to fetch channel balances and report them. It is used as part of various agents and also other internal tools.

For standalone agent on-prem this options are not used but it can use Redis for storing the cache and report metrics to Graphite.

Documentation

Index

Constants

View Source
const PREFIX = "bolt.boltobserver.channelchecker"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelCache

type ChannelCache interface {
	Lock()
	Unlock()
	Get(name string) (string, bool)
	Set(name string, value string)
	DeferredSet(name, old, new string)
	DeferredCommit() bool
	DeferredRevert() bool
}

type ChannelChecker

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

func NewChannelChecker

func NewChannelChecker(ctx context.Context, cache ChannelCache, keepAlive time.Duration, smooth bool, checkGraph bool, monitoring *ChannelCheckerMonitoring) *ChannelChecker

func NewDefaultChannelChecker

func NewDefaultChannelChecker(ctx context.Context, keepAlive time.Duration, smooth bool, checkGraph bool, monitoring *ChannelCheckerMonitoring) *ChannelChecker

func (*ChannelChecker) CustomMetric

func (c *ChannelChecker) CustomMetric(name, value string)

CustomMetric is a method to send custom metrics via graphite

func (*ChannelChecker) EventLoop

func (c *ChannelChecker) EventLoop()

func (*ChannelChecker) GetState

func (c *ChannelChecker) GetState(
	pubKey string,
	uniqueId string,
	getApi NewApiCall,
	settings entities.ReportingSettings,
	optCallback entities.BalanceReportCallback) (*entities.ChannelBalanceReport, error)

Get current state (settings.pollInterval is ignored)

func (*ChannelChecker) IsSubscribed

func (c *ChannelChecker) IsSubscribed(pubKey, uniqueId string) bool

Check if we are subscribed for a certain public key

func (*ChannelChecker) OverrideLoopInterval added in v0.0.3

func (c *ChannelChecker) OverrideLoopInterval(duration time.Duration)

WARNING: this should not be used except for unit testing

func (*ChannelChecker) Subscribe

func (c *ChannelChecker) Subscribe(
	pubKey string,
	uniqueId string,
	getApi NewApiCall,
	settings entities.ReportingSettings,
	callback entities.BalanceReportCallback) error

Subscribe to notifications about channel changes (if already subscribed this will force a callback, use IsSubscribed to check)

func (*ChannelChecker) Unsubscribe

func (c *ChannelChecker) Unsubscribe(pubkey, uniqueId string) error

Unsubscribe from a pubkey

type ChannelCheckerMonitoring

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

func NewChannelCheckerMonitoring

func NewChannelCheckerMonitoring(env, graphiteHost, graphitePort string) *ChannelCheckerMonitoring

func NewNopChannelCheckerMonitoring

func NewNopChannelCheckerMonitoring() *ChannelCheckerMonitoring

type GlobalSettings

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

func NewGlobalSettings

func NewGlobalSettings() *GlobalSettings

func (*GlobalSettings) Delete

func (s *GlobalSettings) Delete(key string)

func (*GlobalSettings) Get

func (s *GlobalSettings) Get(key string) Settings

func (*GlobalSettings) GetKeys

func (s *GlobalSettings) GetKeys() []string

func (*GlobalSettings) Set

func (s *GlobalSettings) Set(key string, value Settings)

type InMemoryChannelCache

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

func NewInMemoryChannelCache

func NewInMemoryChannelCache() *InMemoryChannelCache

func (*InMemoryChannelCache) DeferredCommit

func (c *InMemoryChannelCache) DeferredCommit() bool

func (*InMemoryChannelCache) DeferredRevert

func (c *InMemoryChannelCache) DeferredRevert() bool

func (*InMemoryChannelCache) DeferredSet

func (c *InMemoryChannelCache) DeferredSet(name, old, new string)

func (*InMemoryChannelCache) Get

func (c *InMemoryChannelCache) Get(name string) (string, bool)

func (*InMemoryChannelCache) Lock

func (c *InMemoryChannelCache) Lock()

func (*InMemoryChannelCache) Set

func (c *InMemoryChannelCache) Set(name string, value string)

func (*InMemoryChannelCache) Unlock

func (c *InMemoryChannelCache) Unlock()

type NewApiCall

type NewApiCall func() api.LightingApiCalls

type OldNewVal

type OldNewVal struct {
	OldValue string
	NewValue string
}

type RedisChannelCache

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

func NewRedisChannelCache

func NewRedisChannelCache() *RedisChannelCache

func (*RedisChannelCache) DeferredCommit

func (c *RedisChannelCache) DeferredCommit() bool

func (*RedisChannelCache) DeferredRevert

func (c *RedisChannelCache) DeferredRevert() bool

func (*RedisChannelCache) DeferredSet

func (c *RedisChannelCache) DeferredSet(name, old, new string)

func (*RedisChannelCache) Get

func (c *RedisChannelCache) Get(name string) (string, bool)

func (*RedisChannelCache) Lock

func (c *RedisChannelCache) Lock()

func (*RedisChannelCache) Set

func (c *RedisChannelCache) Set(name string, value string)

func (*RedisChannelCache) Unlock

func (c *RedisChannelCache) Unlock()

type SetOfChanIds

type SetOfChanIds map[uint64]struct{}

type Settings

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

Jump to

Keyboard shortcuts

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