Documentation ¶
Index ¶
- type ChannelCache
- type InMemoryChannelCache
- func (c *InMemoryChannelCache) DeferredCommit() bool
- func (c *InMemoryChannelCache) DeferredRevert() bool
- func (c *InMemoryChannelCache) DeferredSet(name, old, new string)
- func (c *InMemoryChannelCache) Get(name string) (string, bool)
- func (c *InMemoryChannelCache) Lock()
- func (c *InMemoryChannelCache) Set(name string, value string)
- func (c *InMemoryChannelCache) Unlock()
- type NodeData
- func (c *NodeData) EventLoop()
- func (c *NodeData) GetState(pubKey string, uniqueID string, getAPI api.NewAPICall, ...) (*entities.NodeDataReport, error)
- func (c *NodeData) Invalidate() error
- func (c *NodeData) IsSubscribed(pubKey, uniqueID string) bool
- func (c *NodeData) OverrideLoopInterval(duration time.Duration)
- func (c *NodeData) Subscribe(nodeDataCallback entities.NodeDataReportCallback, getAPI api.NewAPICall, ...) error
- func (c *NodeData) Unsubscribe(pubkey, uniqueID string) error
- type OldNewVal
- type PerNodeSettings
- type RedisChannelCache
- func (c *RedisChannelCache) DeferredCommit() bool
- func (c *RedisChannelCache) DeferredRevert() bool
- func (c *RedisChannelCache) DeferredSet(name, old, new string)
- func (c *RedisChannelCache) Get(name string) (string, bool)
- func (c *RedisChannelCache) Lock()
- func (c *RedisChannelCache) Set(name string, value string)
- func (c *RedisChannelCache) Unlock()
- type SetOfChanIds
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelCache ¶
type ChannelCache interface { // Lock - acquire lock Lock() // Unlock - release lock Unlock() // Get - get channel cache Get(name string) (string, bool) // Set - set channel cache Set(name string, value string) // DeferredSet - set channel cache but do not commit it yet DeferredSet(name, old, new string) // DeferredCommit - commit channel cache from DeferredSet DeferredCommit() bool // DeferredRevert - revert channel cache from DeferredSet DeferredRevert() bool }
ChannelCache struct
type InMemoryChannelCache ¶
type InMemoryChannelCache struct {
// contains filtered or unexported fields
}
InMemoryChannelCache - ChannelCache implementation that stores data in memory
func NewInMemoryChannelCache ¶
func NewInMemoryChannelCache() *InMemoryChannelCache
NewInMemoryChannelCache - construct new InMemoryChannelCache
func (*InMemoryChannelCache) DeferredCommit ¶
func (c *InMemoryChannelCache) DeferredCommit() bool
DeferredCommit - commit channel cache from DeferredSet
func (*InMemoryChannelCache) DeferredRevert ¶
func (c *InMemoryChannelCache) DeferredRevert() bool
DeferredRevert - revert channel cache from DeferredSet
func (*InMemoryChannelCache) DeferredSet ¶
func (c *InMemoryChannelCache) DeferredSet(name, old, new string)
DeferredSet - set channel cache but do not commit it yet
func (*InMemoryChannelCache) Get ¶
func (c *InMemoryChannelCache) Get(name string) (string, bool)
Get - get channel cache
func (*InMemoryChannelCache) Set ¶
func (c *InMemoryChannelCache) Set(name string, value string)
Set - set channel cache
type NodeData ¶
type NodeData struct {
// contains filtered or unexported fields
}
NodeData struct
func NewDefaultNodeData ¶
func NewDefaultNodeData(ctx context.Context, keepAlive time.Duration, smooth bool, checkGraph bool, noOnChainBalance bool, monitoring *checkermonitoring.CheckerMonitoring) *NodeData
NewDefaultNodeData constructs a new NodeData
func NewNodeData ¶
func NewNodeData(ctx context.Context, cache ChannelCache, keepAlive time.Duration, smooth bool, checkGraph bool, noOnChainBalance bool, monitoring *checkermonitoring.CheckerMonitoring) *NodeData
NewNodeData constructs a new NodeData
func (*NodeData) GetState ¶
func (c *NodeData) GetState( pubKey string, uniqueID string, getAPI api.NewAPICall, settings entities.ReportingSettings, optCallback entities.NodeDataReportCallback) (*entities.NodeDataReport, error)
GetState - get current state (settings.pollInterval is ignored)
func (*NodeData) Invalidate ¶ added in v0.0.49
Invalidate when data was last reported
func (*NodeData) IsSubscribed ¶
IsSubscribed - check if we are subscribed for a certain public key
func (*NodeData) OverrideLoopInterval ¶
OverrideLoopInterval - WARNING: this should not be used except for unit testing
func (*NodeData) Subscribe ¶
func (c *NodeData) Subscribe( nodeDataCallback entities.NodeDataReportCallback, getAPI api.NewAPICall, pubKey string, settings entities.ReportingSettings, uniqueID string) error
Subscribe - subscribe to notifications about node changes (if already subscribed this will force a callback, use IsSubscribed to check)
func (*NodeData) Unsubscribe ¶
Unsubscribe - unsubscribe from a pubkey
type PerNodeSettings ¶
type PerNodeSettings struct {
// contains filtered or unexported fields
}
PerNodeSettings struct
func NewPerNodeSettings ¶
func NewPerNodeSettings() *PerNodeSettings
NewPerNodeSettings creates PerNodeSettings
func (*PerNodeSettings) Delete ¶
func (s *PerNodeSettings) Delete(key string)
Delete - delete settings for one key
func (*PerNodeSettings) Get ¶
func (s *PerNodeSettings) Get(key string) Settings
Get - get settings for one key
func (*PerNodeSettings) GetKeys ¶
func (s *PerNodeSettings) GetKeys() []string
GetKeys - get all keys
func (*PerNodeSettings) Set ¶
func (s *PerNodeSettings) Set(key string, value Settings)
Set - set settings for one key
type RedisChannelCache ¶
type RedisChannelCache struct {
// contains filtered or unexported fields
}
RedisChannelCache - ChannelCache implementation that stores data in redis
func NewRedisChannelCache ¶
func NewRedisChannelCache() *RedisChannelCache
NewRedisChannelCache - construct new RedisChannelCache
func (*RedisChannelCache) DeferredCommit ¶
func (c *RedisChannelCache) DeferredCommit() bool
DeferredCommit - commit channel cache from DeferredSet
func (*RedisChannelCache) DeferredRevert ¶
func (c *RedisChannelCache) DeferredRevert() bool
DeferredRevert - revert channel cache from DeferredSet
func (*RedisChannelCache) DeferredSet ¶
func (c *RedisChannelCache) DeferredSet(name, old, new string)
DeferredSet - set channel cache but do not commit it yet
func (*RedisChannelCache) Get ¶
func (c *RedisChannelCache) Get(name string) (string, bool)
Get - get channel cache
func (*RedisChannelCache) Set ¶
func (c *RedisChannelCache) Set(name string, value string)
Set - set channel cache