app

package
v0.7.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package app owns node workflows independently of terminal presentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendLightningPayment

func SendLightningPayment(client LightningPaymentClient, payment PreparedPayment) (*lndrpc.SendPaymentResult, error)

SendLightningPayment submits a prepared invoice with at most one daemon call. It does not retry or reinterpret the outcome. Callers own confirmation and duplicate-action prevention; PreparedPayment is not a single-use token. LND revalidates the invoice at execution and retains its existing fee policy.

func StatusServices

func StatusServices(cfg config.AppConfig) []string

func UpdateUnlockArguments

func UpdateUnlockArguments(s protocol.Status) ([]string, error)

UpdateUnlockArguments selects LND's native password prompt. VPN never stores the entered secret.

func ValidateChannelAmount

func ValidateChannelAmount(amount int64) error

func ValidateChannelPeer

func ValidateChannelPeer(pubkey, host string) (string, string, error)

Types

type AccountAccess

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

AccountAccess owns bounded helper observations and owner-side key imports. Close cancels helper waits and joins admitted work, including a local write already in progress. The helper never writes an owner's home for this flow.

func NewAccountAccess

func NewAccountAccess(ssh *SSHAccess) *AccountAccess

func (*AccountAccess) Close

func (a *AccountAccess) Close()

func (*AccountAccess) Import

func (a *AccountAccess) Import(review AccountKeyImport) error

func (*AccountAccess) Inspect

func (a *AccountAccess) Inspect(ref accountaccess.Ref) (AccountDetails, error)

func (*AccountAccess) List

type AccountDetails

type AccountDetails struct {
	accountaccess.Detail
	Authorized       map[string]bool
	OwnerKeysProblem string
}

type AccountKeyImport

type AccountKeyImport struct {
	Account accountaccess.Account
	Key     sshkeys.Key
}

AccountKeyImport freezes the reviewed source identity and exact public key.

type AutoUnlockChanges

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

AutoUnlockChanges owns the local readers for one TUI. Accepted root operations continue independently when the TUI exits or stops observing.

func NewAutoUnlockChanges

func NewAutoUnlockChanges() *AutoUnlockChanges

NewAutoUnlockChanges creates a lifetime owner for helper-backed transitions.

func (*AutoUnlockChanges) Close

func (w *AutoUnlockChanges) Close()

Close cancels and joins readers, including those with no remaining consumer.

func (*AutoUnlockChanges) Disable

func (w *AutoUnlockChanges) Disable() <-chan AutoUnlockResult

Disable immediately starts observation of the host's locked-state transition.

func (*AutoUnlockChanges) Enable

func (w *AutoUnlockChanges) Enable(password autounlock.Password) <-chan AutoUnlockResult

Enable immediately starts observation of one exact password verification.

type AutoUnlockObservation

type AutoUnlockObservation int

AutoUnlockObservation describes what the local caller knows about the request.

const (
	AutoUnlockUnknown AutoUnlockObservation = iota
	AutoUnlockNotStarted
	AutoUnlockObserved
)

type AutoUnlockResult

type AutoUnlockResult struct {
	Observation AutoUnlockObservation
	Transition  autounlock.Result
	Err         error
}

AutoUnlockResult separates local observation from the host's proven outcome. A lost response is never evidence of rollback or a stopped root operation.

type BackupCopy

type BackupCopy struct {
	State BackupCopyState
	At    time.Time
}

BackupCopy holds the state and the time that goes with it: the end of the last run, the start of a run in progress, or the time the timer was switched on while no run has finished since. The time is zero when systemd has none.

func (BackupCopy) Judged

func (c BackupCopy) Judged(now time.Time) BackupCopy

Judged applies the time limit at now, so a record read a while ago never keeps saying the copy is current. A run that hangs is stuck, and a timer switched on long ago without a finished run counts as late.

type BackupCopyState

type BackupCopyState int

BackupCopyState is what systemd's record says about the node's own copy of LND's channel backup, the copy Syncthing sends.

const (
	BackupCopyCurrent BackupCopyState = iota
	BackupCopyFailed
	BackupCopyLate
	BackupCopyChecking
	BackupCopyNotYet
	BackupCopyOff
	BackupCopyNoTimer
	// BackupCopyStuck: a run started more than the limit ago and has not
	// finished. When the last finished run was is not known.
	BackupCopyStuck
)

type ChannelCloseClient

type ChannelCloseClient interface {
	ChannelCloseState(string) (lndrpc.ChannelCloseState, error)
	CloseChannel(lndrpc.ChannelCloseRequest) lndrpc.ChannelCloseResult
}

type ChannelCloseInput

type ChannelCloseInput struct {
	ChannelPoint string
	Force        bool
	SatPerVbyte  int64
}

type ChannelCloseOutcome

type ChannelCloseOutcome int
const (
	CloseNotSubmitted ChannelCloseOutcome = iota
	ClosePending
	CloseConfirmed
	CloseOutcomeUnknown
)

type ChannelCloseResult

type ChannelCloseResult struct {
	State ChannelCloseOutcome
	Txid  string
	Err   error
}

func CloseChannel

func CloseChannel(client ChannelCloseClient, prepared PreparedChannelClose) ChannelCloseResult

CloseChannel rechecks the initial-close state before one RPC. Other operators and peers can still change LND state between the reads and submission.

type ChannelHistoryEntry

type ChannelHistoryEntry struct {
	ChannelPoint    string
	PeerAlias       string
	RemotePubkey    string
	Capacity        int64
	Status          string
	CloseType       string
	BlocksRemaining int32
}

ChannelHistoryEntry preserves source identity without claiming that independent current and closed observations form an atomic channel lifecycle snapshot.

type ChannelHistoryReader

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

ChannelHistoryReader owns the additional closed-channel read. Open and pending channels are reused from status, with independent freshness retained by callers.

func NewChannelHistoryReader

func NewChannelHistoryReader() *ChannelHistoryReader

func (*ChannelHistoryReader) Close

func (r *ChannelHistoryReader) Close()

Close cancels and joins admitted work. Shared client reconnect mutex waits can delay cancellation; this does not own the reconnect or root worker.

func (*ChannelHistoryReader) Collect

type ChannelHistorySnapshot

type ChannelHistorySnapshot struct {
	Closed Observation[[]lndrpc.ClosedChannel]
}

func (ChannelHistorySnapshot) Entries

func (ChannelHistorySnapshot) Retain

type ChannelHistorySource

type ChannelHistorySource interface {
	ListClosedChannelsContext(context.Context) ([]lndrpc.ClosedChannel, error)
}

type ChannelOpenClient

type ChannelOpenClient interface {
	ConnectPeer(string, string) error
	WaitForPeer(string, time.Duration) error
	ListUnspent(int32, int32) ([]lndrpc.UTXO, error)
	OpenChannel(lndrpc.ChannelOpenRequest) lndrpc.ChannelOpenResult
}

type ChannelOpenInput

type ChannelOpenInput struct {
	Pubkey, Host              string
	AmountSats                int64
	FundMax, Private, Taproot bool
	SatPerVbyte               int64
	Outpoints                 []string
}

type ChannelOpenResult

type ChannelOpenResult struct {
	State       ChannelOpenState
	Txid        string
	OutputIndex uint32
	Err         error
}

func OpenChannel

func OpenChannel(client ChannelOpenClient, prepared PreparedChannelOpen) ChannelOpenResult

OpenChannel checks peer readiness and selected availability before one funding call. Preflight reserves nothing; LND checks coins under its wallet lock.

type ChannelOpenState

type ChannelOpenState int
const (
	ChannelNotSubmitted ChannelOpenState = iota
	ChannelBroadcast
	ChannelOutcomeUnknown
)

type ChannelStatus

type ChannelStatus struct {
	Channels []StatusChannel
	Pending  lndrpc.PendingChannelInfo
}

type CoinSelection

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

CoinSelection retains outpoint identity even when a refresh removes a coin. Missing coins must be reviewed or cleared, never replaced by automatic selection.

func (*CoinSelection) Clear

func (s *CoinSelection) Clear()

func (CoinSelection) Contains

func (s CoinSelection) Contains(coin lndrpc.UTXO) bool

func (CoinSelection) Len

func (s CoinSelection) Len() int

func (CoinSelection) Outpoints

func (s CoinSelection) Outpoints() []string

func (*CoinSelection) Toggle

func (s *CoinSelection) Toggle(coin lndrpc.UTXO)

func (CoinSelection) Total

func (s CoinSelection) Total(available []lndrpc.UTXO) (int64, error)

type ConnectionCredential

type ConnectionCredential string

ConnectionCredential holds raw staged bytes. String formatting deliberately redacts them; callers must explicitly convert for a credential display.

func (ConnectionCredential) GoString

func (c ConnectionCredential) GoString() string

func (ConnectionCredential) String

func (ConnectionCredential) String() string

type ConnectionInfo

type ConnectionInfo struct {
	Address       string
	AddressErr    error
	CredentialErr error
	Credential    ConnectionCredential
	Target        ConnectionTarget
}

ConnectionInfo is one read of an endpoint and its deliberately staged credential. It does not prove remote reachability or successful authentication. The credential is explicit; default string formatting redacts it.

func (ConnectionInfo) CredentialText

func (i ConnectionInfo) CredentialText() string

CredentialText is for an explicit credential display, never diagnostics.

func (ConnectionInfo) GoString

func (i ConnectionInfo) GoString() string

func (ConnectionInfo) HasCredential

func (i ConnectionInfo) HasCredential() bool

func (ConnectionInfo) String

func (i ConnectionInfo) String() string

func (ConnectionInfo) URL

func (i ConnectionInfo) URL(host string) string

URL formats the existing REST connection contract. The caller supplies a freshly observed public IP for the optional clearnet endpoint.

type ConnectionInfoReader

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

ConnectionInfoReader owns read cancellation and joining for one terminal. Helper reads have a 30-second local deadline including queue time. This does not interrupt root work. Ordinary staged-file reads finish before Close returns.

func NewConnectionInfoReader

func NewConnectionInfoReader() *ConnectionInfoReader

func (*ConnectionInfoReader) Close

func (r *ConnectionInfoReader) Close()

func (*ConnectionInfoReader) Read

type ConnectionTarget

type ConnectionTarget int

ConnectionTarget selects one of the existing operator connection displays.

const (
	LNDRESTConnection ConnectionTarget = iota
	SyncthingWebConnection
)

type FeeReader

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

FeeReader owns local read lifetimes for one terminal session. Callers own scheduling, request identity and publication; no cross-form cache is kept.

func NewFeeReader

func NewFeeReader() *FeeReader

func (*FeeReader) Close

func (r *FeeReader) Close()

func (*FeeReader) Collect

func (r *FeeReader) Collect(caller context.Context, network string) FeeSuggestions

Collect bounds the whole collection and cancels it when either its form or terminal session closes. An individual unavailable estimate does not discard the other targets; cancellation discards the interrupted collection.

type FeeSuggestions

type FeeSuggestions struct {
	Tiers [3]bitcoin.FeeEstimate
	Err   error
}

FeeSuggestions contains independent estimates for the fast, medium and slow requested targets. A zero entry is unavailable; successful entries retain the actual target returned by Core. These are hints, not exact transaction quotes.

type HelperOperation

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

func (*HelperOperation) Events

func (o *HelperOperation) Events() <-chan HelperProgress

func (*HelperOperation) Kind

func (*HelperOperation) Steps

func (o *HelperOperation) Steps() []string

type HelperProgress

type HelperProgress struct {
	Index  int
	Result *HelperWorkflowResult
}

HelperProgress reports one completed step, or the terminal result at Index. The terminal event occupies the next index and is emitted exactly once.

type HelperWorkflowKind

type HelperWorkflowKind int
const (
	SyncthingInstall HelperWorkflowKind = iota
	P2PUpgrade
	SelfUpdate
)

type HelperWorkflowResult

type HelperWorkflowResult struct {
	HelperSucceeded bool
	NothingChanged  bool
	Config          *config.AppConfig
	Err             error
}

HelperWorkflowResult distinguishes successful mutation from a failed local configuration read. An error never establishes that earlier changes were undone. NothingChanged is set only when the helper reported that the request failed before changing anything, or the request never reached it.

type HelperWorkflows

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

HelperWorkflows owns this client's streaming operations. Close cancels local observation and waits for its readers to release their connections. The helper retains authority to finish accepted operations, including after this TUI exits.

func NewHelperWorkflows

func NewHelperWorkflows(syncthingVersion string) *HelperWorkflows

func (*HelperWorkflows) Close

func (w *HelperWorkflows) Close()

func (*HelperWorkflows) InstallSyncthing

func (w *HelperWorkflows) InstallSyncthing() *HelperOperation

func (*HelperWorkflows) ReadP2PAddress

func (w *HelperWorkflows) ReadP2PAddress(parent context.Context) (p2p.UpgradeRequest, error)

ReadP2PAddress makes a fresh, bounded observation for one confirmation screen. Both screen cancellation and terminal shutdown release the read.

func (*HelperWorkflows) UpdateSelf

func (w *HelperWorkflows) UpdateSelf(version string) *HelperOperation

func (*HelperWorkflows) UpgradeP2P

func (w *HelperWorkflows) UpgradeP2P(request p2p.UpgradeRequest, client P2PConnection) *HelperOperation

type InvoiceRequest

type InvoiceRequest struct {
	AmountSats int64
	Memo       string
	Blinded    bool
}

type InvoiceState

type InvoiceState int
const (
	InvoicePending InvoiceState = iota
	InvoicePaid
	InvoiceExpired
	InvoiceCanceled
	InvoiceMissing
)

func CheckLightningInvoice

func CheckLightningInvoice(client LightningInvoiceClient, invoice LightningInvoice) (InvoiceState, error)

CheckLightningInvoice distinguishes a missing record from a failed lookup. Neither establishes whether payment succeeded.

type LightningInvoice

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

LightningInvoice binds the displayed invoice to the hash used to check it.

func CreateLightningInvoice

func CreateLightningInvoice(client LightningInvoiceClient, request InvoiceRequest) (LightningInvoice, error)

func (LightningInvoice) AmountSats

func (i LightningInvoice) AmountSats() int64

func (LightningInvoice) PaymentRequest

func (i LightningInvoice) PaymentRequest() string

type LightningInvoiceClient

type LightningInvoiceClient interface {
	AddInvoice(int64, string, bool) (*lndrpc.Invoice, error)
	LookupInvoice([]byte) (*lndrpc.Invoice, error)
}

type LightningPaymentClient

type LightningPaymentClient interface {
	DecodePayReq(string) (*lndrpc.DecodedPayReq, error)
	SendPayment(string) (*lndrpc.SendPaymentResult, error)
}

LightningPaymentClient is the daemon access needed to prepare and pay an invoice. LND retains responsibility for routing and recovering stream outcomes.

type NodeUpdates

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

NodeUpdates owns observation lifetimes. Canceling a client never cancels the root-owned job; another terminal can read and resume that same job.

func NewNodeUpdates

func NewNodeUpdates() *NodeUpdates

func (*NodeUpdates) Cancel

func (w *NodeUpdates) Cancel(id string) (protocol.Status, error)

func (*NodeUpdates) Close

func (w *NodeUpdates) Close()

func (*NodeUpdates) Prepare

func (w *NodeUpdates) Prepare(version string) (protocol.Review, error)

func (*NodeUpdates) Resume

func (w *NodeUpdates) Resume(id string) (protocol.Status, error)

func (*NodeUpdates) Start

func (w *NodeUpdates) Start(token string) (protocol.Status, error)

func (*NodeUpdates) Status

func (w *NodeUpdates) Status() (protocol.Status, error)

type Observation

type Observation[T any] struct {
	Value      T
	ObservedAt time.Time
	Err        error
}

Observation retains the last successful value and the latest read error. A zero observation is unavailable, not a successful zero or empty result.

func (Observation[T]) Fresh

func (o Observation[T]) Fresh() bool

func (Observation[T]) Known

func (o Observation[T]) Known() bool

type OnChainReader

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

OnChainReader owns local read lifetimes. Scheduling and same-wallet retention belong to its caller; the two reads do not form an atomic wallet snapshot.

func NewOnChainReader

func NewOnChainReader() *OnChainReader

func (*OnChainReader) Close

func (r *OnChainReader) Close()

Close cancels and joins local reads. Shared LND reconnect mutex waits can still delay the join; this owner does not change connection recovery.

func (*OnChainReader) Collect

func (r *OnChainReader) Collect(source OnChainSource) OnChainSnapshot

func (*OnChainReader) ReadTransactions

func (r *OnChainReader) ReadTransactions(caller context.Context, source OnChainSource) Observation[[]lndrpc.OnChainTx]

func (*OnChainReader) ReadUnspent

func (r *OnChainReader) ReadUnspent(caller context.Context, source OnChainSource, minConfs, maxConfs int32) Observation[[]lndrpc.UTXO]

ReadUnspent and ReadTransactions share the terminal owner while allowing forms to publish each observation as soon as it completes. Each caller can cancel its own reads without canceling another form or the On-Chain view.

type OnChainReceiveAddress

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

OnChainReceiveAddress is a validated P2TR address returned by LND.

func CreateOnChainAddress

func CreateOnChainAddress(client OnChainReceiveClient, network, previous string) (OnChainReceiveAddress, error)

CreateOnChainAddress requests once. An error does not prove LND failed to derive an address; an explicit retry requests another, without retiring any previously issued address. Network encoding cannot distinguish signet from testnet4, so the installed daemon remains the authority for chain identity.

func (OnChainReceiveAddress) Text

func (a OnChainReceiveAddress) Text() string

type OnChainReceiveClient

type OnChainReceiveClient interface {
	GetNewAddress() (*lndrpc.OnChainAddress, error)
}

type OnChainSendClient

type OnChainSendClient interface {
	ListUnspent(int32, int32) ([]lndrpc.UTXO, error)
	SendCoins(lndrpc.SendCoinsRequest) (*lndrpc.SendCoinsResult, error)
}

type OnChainSendInput

type OnChainSendInput struct {
	Address     string
	AmountSats  int64
	SendAll     bool
	SatPerVbyte int64
	Label       string
	Outpoints   []string
}

type OnChainSendResult

type OnChainSendResult struct {
	State OnChainSendState
	Txid  string
	Err   error
}

func SendOnChain

func SendOnChain(client OnChainSendClient, prepared PreparedOnChainSend) OnChainSendResult

SendOnChain rechecks explicit inputs and makes at most one send RPC. LND validates and selects under its own wallet lock; this precheck reserves nothing. A lost RPC response cannot prove that no transaction was published.

type OnChainSendState

type OnChainSendState int
const (
	OnChainNotSubmitted OnChainSendState = iota
	OnChainBroadcast
	OnChainOutcomeUnknown
)

type OnChainSnapshot

type OnChainSnapshot struct {
	Utxos      Observation[[]lndrpc.UTXO]
	OnChainTxs Observation[[]lndrpc.OnChainTx]
}

func (OnChainSnapshot) Retain

func (s OnChainSnapshot) Retain(previous OnChainSnapshot) OnChainSnapshot

func (OnChainSnapshot) Unavailable

func (s OnChainSnapshot) Unavailable(err error) OnChainSnapshot

type OnChainSource

type OnChainSource interface {
	ListUnspentContext(context.Context, int32, int32) ([]lndrpc.UTXO, error)
	GetTransactionsContext(context.Context) ([]lndrpc.OnChainTx, error)
}

type P2PConnection

type P2PConnection interface{ ReconnectContext(context.Context) }

type PackageUpdateOutcome

type PackageUpdateOutcome int
const (
	PackageUpdateUnconfirmed PackageUpdateOutcome = iota
	PackageUpdateNotStarted
	PackageUpdateCompleted
)

type PackageUpdateResult

type PackageUpdateResult struct {
	Outcome PackageUpdateOutcome
	Err     error
}

type PackageUpdates

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

PackageUpdates owns local observation, not the accepted root transaction. Closing it releases and joins readers without killing apt or retrying work.

func NewPackageUpdates

func NewPackageUpdates() *PackageUpdates

func (*PackageUpdates) Close

func (u *PackageUpdates) Close()

func (*PackageUpdates) Update

func (u *PackageUpdates) Update() <-chan PackageUpdateResult

type PaymentHistoryReader

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

PaymentHistoryReader owns collection and local cancellation. The independent RPC windows are not a complete ledger or an atomic balance snapshot.

func NewPaymentHistoryReader

func NewPaymentHistoryReader() *PaymentHistoryReader

func (*PaymentHistoryReader) Close

func (r *PaymentHistoryReader) Close()

Close joins admitted reads. Existing shared reconnect mutex waits can delay cancellation; this owner does not change connection or root-worker recovery.

func (*PaymentHistoryReader) Collect

type PaymentHistorySnapshot

type PaymentHistorySnapshot struct {
	Invoices Observation[[]lndrpc.PaymentEntry]
	Payments Observation[[]lndrpc.PaymentEntry]
}

func (PaymentHistorySnapshot) Entries

Entries merges the two recent windows without changing either observation. Stable ties use direction and the daemon's index, not reply order.

func (PaymentHistorySnapshot) Fresh

func (s PaymentHistorySnapshot) Fresh() bool

func (PaymentHistorySnapshot) Retain

func (PaymentHistorySnapshot) Unavailable

type PaymentHistorySource

type PaymentHistorySource interface {
	ListInvoicesContext(context.Context, uint64) ([]lndrpc.PaymentEntry, error)
	ListPaymentsContext(context.Context, uint64) ([]lndrpc.PaymentEntry, error)
}

type PaymentRequest

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

PaymentRequest contains an invoice that passed the installed network prefilter. LND must still decode and validate the invoice; a prefix is not proof of validity.

func ParseLightningPayment

func ParseLightningPayment(network, raw string) (PaymentRequest, error)

ParseLightningPayment normalizes pasted input and applies the node's network policy before any daemon call. It does not authorize sending a payment.

func (PaymentRequest) Invoice

func (r PaymentRequest) Invoice() string

type PreparedChannelClose

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

PreparedChannelClose owns the channel, mode and fee policy shown for approval.

func PrepareChannelClose

func PrepareChannelClose(input ChannelCloseInput) (PreparedChannelClose, error)

func (PreparedChannelClose) Request

type PreparedChannelOpen

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

PreparedChannelOpen owns the reviewed request. Selected coins are the allowed funding pool; LND can use a subset and determines fees, capacity and change. Preparation does not reserve coins or construct a funding transaction.

func PrepareChannelOpen

func PrepareChannelOpen(input ChannelOpenInput, available []lndrpc.UTXO) (PreparedChannelOpen, error)

func (PreparedChannelOpen) Request

func (PreparedChannelOpen) SelectedTotal

func (p PreparedChannelOpen) SelectedTotal() int64

type PreparedOnChainSend

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

PreparedOnChainSend owns the reviewed intent, including automatic selection when Outpoints is empty. It is not a signed transaction or a single-use token. LND's pinned EstimateFee API cannot quote manual-rate or send-all requests; no total fee, net Max amount, or change amount is promised here.

func PrepareOnChainSend

func PrepareOnChainSend(network string, input OnChainSendInput, available []lndrpc.UTXO) (PreparedOnChainSend, error)

func (PreparedOnChainSend) Coins

func (p PreparedOnChainSend) Coins() []lndrpc.UTXO

func (PreparedOnChainSend) Request

type PreparedPayment

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

PreparedPayment keeps the decoded details and their exact invoice together. Its fields are private so editing a form or a details copy cannot change what will be submitted after confirmation.

func PrepareLightningPayment

func PrepareLightningPayment(client LightningPaymentClient, request PaymentRequest) (PreparedPayment, error)

func (PreparedPayment) Details

func (p PreparedPayment) Details() lndrpc.DecodedPayReq

type PreparedTransactionLabel

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

PreparedTransactionLabel keeps the transaction and text fixed after Save. Labels belong to a transaction, including all of its wallet outputs.

func PrepareTransactionLabel

func PrepareTransactionLabel(txid, label string) (PreparedTransactionLabel, error)

type RebootOutcome

type RebootOutcome int
const (
	RebootUnconfirmed RebootOutcome = iota
	RebootNotStarted
	RebootAccepted
)

type RebootResult

type RebootResult struct {
	Outcome RebootOutcome
	Err     error
}

type Reboots

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

Reboots owns local observation for one terminal session. Close cancels and joins readers without canceling an accepted host request or retrying it.

func NewReboots

func NewReboots() *Reboots

func (*Reboots) Close

func (r *Reboots) Close()

func (*Reboots) Request

func (r *Reboots) Request() <-chan RebootResult

type SSHAccess

type SSHAccess struct {
	Keys sshkeys.Store
	Auth SSHAuth
}

func NewSSHAccess

func NewSSHAccess() *SSHAccess

func (*SSHAccess) AddKey

func (s *SSHAccess) AddKey(line string) error

func (*SSHAccess) ListKeys

func (s *SSHAccess) ListKeys() ([]SSHKey, error)

func (*SSHAccess) PasswordAuth

func (s *SSHAccess) PasswordAuth() (bool, error)

func (*SSHAccess) RemoveKey

func (s *SSHAccess) RemoveKey(fingerprint string) error

RemoveKey evaluates the current file and password setting at apply time. All copies of the selected fingerprint are removed; duplicates are one credential.

func (*SSHAccess) SetPasswordAuthDisabled

func (s *SSHAccess) SetPasswordAuthDisabled(disabled bool) error

type SSHAuth

type SSHAuth interface {
	PasswordAuth() (bool, error)
	SetPasswordAuthDisabled(disabled bool) error
}

SSHAuth is the narrow privileged boundary. Key files are edited as the operator.

type SSHKey

type SSHKey = sshkeys.Key

func ParseSSHKey

func ParseSSHKey(line string) (SSHKey, error)

type SSHLoginVerifier

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

SSHLoginVerifier asks the helper to verify first-login evidence and may clear the pending marker. Close cancels and joins local waits, not accepted root work.

func NewSSHLoginVerifier

func NewSSHLoginVerifier() *SSHLoginVerifier

func (*SSHLoginVerifier) Close

func (r *SSHLoginVerifier) Close()

func (*SSHLoginVerifier) Verify

func (r *SSHLoginVerifier) Verify() SSHVerification

Verify may clear the root-owned pending marker when sshd evidence verifies the login. An already-clear marker also succeeds. Address is only a hint.

type SSHVerification

type SSHVerification struct {
	Pending bool
	Address string
	Err     error
}

SSHVerification is one completed first-login observation. Address is only a display hint; failure to observe it must not change the verification fact.

type SecurityUpdatesState

type SecurityUpdatesState int

SecurityUpdatesState is how the System screen reports Debian's automatic security updates.

const (
	SecurityUpdatesCurrent SecurityUpdatesState = iota
	SecurityUpdatesNotRunYet
	SecurityUpdatesOverdue
)

func SecurityUpdatesStatus

func SecurityUpdatesStatus(u system.SecurityUpdates, now time.Time) (SecurityUpdatesState, time.Time)

SecurityUpdatesStatus judges the recorded runs at now. The time returned is the last successful run, or the install of the settings when none has run since.

type ServiceActionOutcome

type ServiceActionOutcome int
const (
	ServiceActionUnconfirmed ServiceActionOutcome = iota
	ServiceActionNotStarted
	ServiceActionCompleted
)

type ServiceActionResult

type ServiceActionResult struct {
	Outcome ServiceActionOutcome
	Err     error
}

type ServiceControls

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

ServiceControls owns bounded helper observation for one terminal session. Close cancels and joins local work, not root mutations already accepted.

func NewServiceControls

func NewServiceControls() *ServiceControls

func (*ServiceControls) Close

func (s *ServiceControls) Close()

func (*ServiceControls) Control

func (s *ServiceControls) Control(request servicecontrol.Request) <-chan ServiceActionResult

type StatusChannel

type StatusChannel struct {
	lndrpc.Channel
	Pending bool
}

type StatusCollector

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

StatusCollector owns observation I/O and its cache for one terminal session. Scheduling and publication stay with the caller. RPCs and helper reads share a deadline. Separate daemon RPCs are not an atomic snapshot.

func NewStatusCollector

func NewStatusCollector() *StatusCollector

func (*StatusCollector) Close

func (c *StatusCollector) Close()

Close cancels and joins local readers. Existing shared LND client mutex waits can delay the join. Automatic reconnection is not owned by this collector.

func (*StatusCollector) Collect

func (c *StatusCollector) Collect(cfg config.AppConfig, walletExists bool, client StatusLND) StatusSnapshot

type StatusLND

type StatusLND interface {
	GetStateContext(context.Context) (lndrpc.WalletState, error)
	GetInfoContext(context.Context) (*lndrpc.NodeInfo, error)
	GetWalletBalanceContext(context.Context) (*lndrpc.WalletBalance, error)
	ListChannelsContext(context.Context) ([]lndrpc.Channel, error)
	GetPendingChannelsContext(context.Context) (*lndrpc.PendingChannelInfo, error)
}

type StatusSnapshot

func (StatusSnapshot) Retain

func (s StatusSnapshot) Retain(previous StatusSnapshot) StatusSnapshot

Retain combines failures with last-good values from the same observation scope. Callers must discard the previous snapshot when that scope changes.

func (StatusSnapshot) WalletUnavailable

func (s StatusSnapshot) WalletUnavailable(err error) StatusSnapshot

WalletUnavailable preserves observations for display without treating a failed presence read as a change of wallet or proof of current balances.

type Syncthing

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

Syncthing owns bounded runtime workflows. The daemon remains configuration authority. A successful pair configures this node, not the remote receiver.

func NewSyncthing

func NewSyncthing() *Syncthing

func (*Syncthing) Close

func (s *Syncthing) Close()

Close cancels and joins local calls. Accepted daemon writes are not rolled back.

func (*Syncthing) ListDevices

func (s *Syncthing) ListDevices() ([]syncthing.Device, error)

func (*Syncthing) Observe

func (s *Syncthing) Observe() SyncthingObservation

Observe reads the copy job's record, the devices and what each device holds.

func (*Syncthing) Pair

func (s *Syncthing) Pair(input string) SyncthingResult

func (*Syncthing) Remove

func (s *Syncthing) Remove(input string) SyncthingResult

type SyncthingClient

type SyncthingClient interface {
	CanonicalID(context.Context, string) (string, error)
	LocalID(context.Context) (string, error)
	ListDevices(context.Context) ([]syncthing.Device, error)
	BackupDelivery(context.Context, []syncthing.Device) (map[string]syncthing.Delivery, error)
	ConfirmPrivacy(context.Context) error
	BackupFolder(context.Context, string) (syncthing.BackupFolder, error)
	AddDevice(context.Context, string) error
	ShareBackup(context.Context, syncthing.BackupFolder, string) error
	RemoveDevice(context.Context, string) error
}

type SyncthingObservation

type SyncthingObservation struct {
	Devices     []syncthing.Device
	DevicesErr  error
	Delivery    map[string]syncthing.Delivery
	DeliveryErr error
	Copy        BackupCopy
	CopyErr     error
}

SyncthingObservation is one read for the Syncthing screens. The backup copy comes from systemd and stays readable when Syncthing is not.

type SyncthingOutcome

type SyncthingOutcome int
const (
	SyncthingNotChanged SyncthingOutcome = iota
	SyncthingComplete
	SyncthingPartial
	SyncthingUnknown
)

type SyncthingResult

type SyncthingResult struct {
	Outcome  SyncthingOutcome
	DeviceID string
	LocalID  string
	Err      error
}

type TransactionLabelClient

type TransactionLabelClient interface {
	SetTransactionLabel(lndrpc.TransactionLabelRequest) lndrpc.TransactionLabelResult
}

type TransactionLabelOutcome

type TransactionLabelOutcome int
const (
	TransactionLabelUnknown TransactionLabelOutcome = iota
	TransactionLabelNotSaved
	TransactionLabelSaved
)

type TransactionLabelResult

type TransactionLabelResult struct {
	Outcome TransactionLabelOutcome
	Err     error
}

func SaveTransactionLabel

func SaveTransactionLabel(client TransactionLabelClient, prepared PreparedTransactionLabel) TransactionLabelResult

SaveTransactionLabel makes one request. An attempted RPC with a lost response does not establish whether LND saved the label, and is never retried here.

type WalletClientResult

type WalletClientResult struct {
	Client *lndrpc.Client
	Err    error
}

type WalletCreation

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

WalletCreation owns bounded readiness and finalization calls for one TUI. Interactive password and seed input stays with the terminal adapter. Close cancels local observation, not an accepted LND or helper mutation.

func NewWalletCreation

func NewWalletCreation() *WalletCreation

func (*WalletCreation) Close

func (w *WalletCreation) Close()

func (*WalletCreation) Finalize

func (w *WalletCreation) Finalize(execution WalletExecution) WalletCreationResult

Finalize can be called again to reobserve and stage credentials. It never invokes wallet creation or infers seed acknowledgement from wallet existence.

func (*WalletCreation) Prepare

func (w *WalletCreation) Prepare(network string) (string, error)

Prepare returns the validated lncli network only after a fresh NON_EXISTING observation. The deadline includes RPC duration and retry waits. Another process may still create a wallet afterward; LND remains the final authority.

type WalletCreationResult

type WalletCreationResult struct {
	Presence          WalletPresence
	CredentialsStaged bool
	SeedAcknowledged  bool
	Err               error
}

func (WalletCreationResult) CanRetryFinalization

func (r WalletCreationResult) CanRetryFinalization() bool

type WalletExecution

type WalletExecution struct {
	Created          bool
	SeedAcknowledged bool
	Err              error
}

WalletExecution records process evidence separately from terminal restoration. A failed command does not establish that InitWallet was rejected by LND.

type WalletObservation

type WalletObservation struct {
	Presence WalletPresence
	Err      error
}

type WalletPresence

type WalletPresence int
const (
	WalletUnknown WalletPresence = iota
	WalletAbsent
	WalletPresent
)

type WalletRuntime

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

WalletRuntime owns local presence reads and unpublished clients for one TUI. Claim transfers a client to the caller. Close cancels and joins local work, and closes any client whose completion was never claimed by the event loop. Cancellation cannot undo credential staging already accepted by the helper.

func NewWalletRuntime

func NewWalletRuntime() *WalletRuntime

func (*WalletRuntime) Claim

func (r *WalletRuntime) Claim(client *lndrpc.Client) bool

func (*WalletRuntime) Close

func (r *WalletRuntime) Close()

func (*WalletRuntime) Discard

func (r *WalletRuntime) Discard(client *lndrpc.Client)

Discard only closes a still-unclaimed client. Duplicate or obsolete messages cannot close a client already published to the rest of the application.

func (*WalletRuntime) Open

func (r *WalletRuntime) Open(caller context.Context, stagedOnly bool) WalletClientResult

Open keeps ordinary startup's probe/repair separate from the staged-only post-creation path. The deadline includes any helper queue and retry waits. Ordinary file reads must finish before cancellation can join the worker.

func (*WalletRuntime) Read

Jump to

Keyboard shortcuts

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