automation

package
v0.18.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ManagedRebalanceChannel = make(chan ManagedRebalance) //nolint:gochecknoglobals

Functions

func AddRebalanceAndChannels added in v0.18.1

func AddRebalanceAndChannels(db *sqlx.DB, rebalancer *Rebalancer) error

func AddRebalanceLog added in v0.18.1

func AddRebalanceLog(db *sqlx.DB, rebalanceResult RebalanceResult) error

func CronTriggerMonitor added in v0.18.1

func CronTriggerMonitor(ctx context.Context, db *sqlx.DB)

func EventTriggerMonitor

func EventTriggerMonitor(ctx context.Context, db *sqlx.DB,
	broadcaster broadcast.BroadcastServer)

func ManagedRebalanceCache added in v0.18.1

func ManagedRebalanceCache(ch chan ManagedRebalance, ctx context.Context)

func RebalanceServiceStart added in v0.18.1

func RebalanceServiceStart(ctx context.Context, conn *grpc.ClientConn, db *sqlx.DB, nodeId int,
	broadcaster broadcast.BroadcastServer)

func RegisterAutomationRoutes

func RegisterAutomationRoutes(r *gin.RouterGroup, db *sqlx.DB, rebalanceRequestChannel chan commons.RebalanceRequest)

func ScheduledTriggerMonitor added in v0.18.1

func ScheduledTriggerMonitor(ctx context.Context, db *sqlx.DB,
	lightningRequestChannel chan interface{},
	rebalanceRequestChannel chan commons.RebalanceRequest)

func SendToManagedRebalanceChannel added in v0.18.1

func SendToManagedRebalanceChannel(ch chan ManagedRebalance, managedRebalance ManagedRebalance)

func SendToManagedRebalanceResultChannel added in v0.18.1

func SendToManagedRebalanceResultChannel(ch chan RebalanceResult, rebalanceResult RebalanceResult)

func SendToRebalancersChannel added in v0.18.1

func SendToRebalancersChannel(ch chan []*Rebalancer, rebalancers []*Rebalancer)

func SetRebalanceAndChannels added in v0.18.1

func SetRebalanceAndChannels(db *sqlx.DB, rebalancer Rebalancer) error

func TimeTriggerMonitor

func TimeTriggerMonitor(ctx context.Context, db *sqlx.DB)

Types

type CronTriggerParams added in v0.18.1

type CronTriggerParams struct {
	CronValue string `json:"cronValue"`
}

type ManagedRebalance added in v0.18.1

type ManagedRebalance struct {
	Type               ManagedRebalanceCacheOperationType
	Origin             commons.RebalanceRequestOrigin
	OriginId           int
	OriginReference    string
	IncomingChannelId  int
	IncomingPublicKey  string
	OutgoingChannelId  int
	OutgoingPublicKey  string
	AmountMsat         uint64
	Status             *commons.Status
	Rebalancer         *Rebalancer
	RebalanceResult    RebalanceResult
	Out                chan ManagedRebalance
	BoolOut            chan bool
	RebalanceResultOut chan RebalanceResult
	RebalancersOut     chan []*Rebalancer
}

type ManagedRebalanceCacheOperationType added in v0.18.1

type ManagedRebalanceCacheOperationType uint
const (
	READ_REBALANCER ManagedRebalanceCacheOperationType = iota
	READ_REBALANCERS
	WRITE_REBALANCER
	DELETE_REBALANCER
	READ_REBALANCE_RESULT
	READ_REBALANCE_RESULT_BY_ORIGIN
	WRITE_REBALANCE_RESULT
)

type RebalanceResult added in v0.18.1

type RebalanceResult struct {
	RebalanceId       int            `json:"rebalanceId"`
	OutgoingChannelId int            `json:"outgoingChannelId"`
	IncomingChannelId int            `json:"incomingChannelId"`
	Status            commons.Status `json:"status"`
	Hops              string         `json:"hops"`
	TotalTimeLock     uint32         `json:"total_time_lock"`
	TotalFeeMsat      uint64         `json:"total_fee_msat"`
	TotalAmountMsat   uint64         `json:"total_amount_msat"`
	Error             string         `json:"error"`
	CreatedOn         time.Time      `json:"createdOn"`
	UpdateOn          time.Time      `json:"updateOn"`

	Route *lnrpc.Route `json:"-"`
}

type RebalanceRunner added in v0.18.1

type RebalanceRunner struct {
	RebalanceId       int
	OutgoingChannelId int
	IncomingChannelId int
	Invoices          map[uint64]*lnrpc.AddInvoiceResponse
	// FailedHops map[hopSourcePublicKey_hopDestinationPublicKey]amountMsat
	FailedHops  map[string]uint64
	FailedPairs []*lnrpc.NodePair
	Status      commons.Status
	Ctx         context.Context
	Cancel      context.CancelFunc
}

type Rebalancer added in v0.18.1

type Rebalancer struct {
	NodeId          int
	RebalanceId     int
	Status          commons.Status
	CreatedOn       time.Time
	UpdateOn        time.Time
	GlobalCtx       context.Context
	RebalanceCtx    context.Context
	RebalanceCancel context.CancelFunc
	Runners         map[int]*RebalanceRunner
	Request         commons.RebalanceRequest
}

Jump to

Keyboard shortcuts

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