operations

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOperationRetryContext

func CreateOperationRetryContext(ctx context.Context) (ctx1 context.Context)

func RunWithOperationCache

func RunWithOperationCache(ctx context.Context, fn func(ctx context.Context) error) error

Types

type Manager

type Manager interface {
	RegisterHandler(ctx context.Context, handler OperationHandler, ops []fftypes.OpType)
	PrepareOperation(ctx context.Context, op *fftypes.Operation) (*fftypes.PreparedOperation, error)
	RunOperation(ctx context.Context, op *fftypes.PreparedOperation, options ...RunOperationOption) error
	RetryOperation(ctx context.Context, ns string, opID *fftypes.UUID) (*fftypes.Operation, error)
	AddOrReuseOperation(ctx context.Context, op *fftypes.Operation) error
}

func NewOperationsManager

func NewOperationsManager(ctx context.Context, di database.Plugin) (Manager, error)

type OperationHandler

type OperationHandler interface {
	fftypes.Named
	PrepareOperation(ctx context.Context, op *fftypes.Operation) (*fftypes.PreparedOperation, error)
	RunOperation(ctx context.Context, op *fftypes.PreparedOperation) (outputs fftypes.JSONObject, complete bool, err error)
}

type RunOperationOption

type RunOperationOption int
const (
	RemainPendingOnFailure RunOperationOption = iota
)

Jump to

Keyboard shortcuts

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