rollback

package
v0.0.0-...-c5b8800 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncRollback

type FuncRollback struct {
	Name string
	Fn   func()
}

FuncRollback records function used to rolling back some operations. It is currently used by units' Init to release resources when failing in the half-way.

type FuncRollbackHolder

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

FuncRollbackHolder holds some RollbackFuncs.

func NewRollbackHolder

func NewRollbackHolder(owner string) *FuncRollbackHolder

NewRollbackHolder creates a new FuncRollbackHolder instance.

func (*FuncRollbackHolder) Add

func (h *FuncRollbackHolder) Add(fn FuncRollback)

Add adds a func to the holder.

func (*FuncRollbackHolder) RollbackReverseOrder

func (h *FuncRollbackHolder) RollbackReverseOrder()

RollbackReverseOrder executes rollback functions in reverse order.

Jump to

Keyboard shortcuts

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