Documentation
¶
Index ¶
- Variables
- func Cancel(ctx context.Context, db *sql.DB, id int64, reason string) error
- func Pause(ctx context.Context, db *sql.DB, id int64) error
- func RecordExecution(ctx context.Context, db *sql.DB, denialID int64, fromTxID string, ...) error
- func Resume(ctx context.Context, db *sql.DB, id int64) error
- func Update(ctx context.Context, db *sql.DB, id int64, delay time.Duration, numHops int32, ...) error
- type Denial
- func Create(ctx context.Context, db *sql.DB, walletID string, txid string, vout int32, ...) (Denial, error)
- func Get(ctx context.Context, db *sql.DB, id int64) (Denial, error)
- func GetByTip(ctx context.Context, db *sql.DB, tipTxID string, tipVout *int32) (*Denial, error)
- func List(ctx context.Context, db *sql.DB, opts ...Option) ([]Denial, error)
- type ExecutedDenial
- type Option
- type TargetSizes
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("denial not found")
ErrNotFound is returned when no denial matches the ID and state of the call.
Functions ¶
func RecordExecution ¶
func RecordExecution(ctx context.Context, db *sql.DB, denialID int64, fromTxID string, fromVout int32, toTxID string, toVout uint32) error
RecordExecution records a completed denial transaction
Types ¶
type Denial ¶
type Denial struct {
ID int64 `db:"id"`
WalletID *string `db:"wallet_id"`
TipTXID string `db:"tip_txid"`
TipVout int32 `db:"tip_vout"`
DelayDuration time.Duration `db:"delay_duration"`
NumHops int32 `db:"num_hops"`
TargetUTXOSizes TargetSizes `db:"target_utxo_sizes"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
CancelledAt *time.Time `db:"cancelled_at"`
CancelReason *string `db:"cancelled_reason"`
PausedAt *time.Time `db:"paused_at"`
NextExecution *time.Time
ExecutedDenials []ExecutedDenial
}
type ExecutedDenial ¶
type Option ¶
type Option func(c *config)
func WithExcludeCancelled ¶
func WithExcludeCancelled() Option
type TargetSizes ¶
type TargetSizes []int64
TargetSizes holds the UTXO sizes to create, one per hop. The database stores them as comma-separated text.
func (*TargetSizes) Scan ¶
func (t *TargetSizes) Scan(src any) error
Click to show internal directories.
Click to hide internal directories.