operation

package
v0.0.0-...-a6f45d6 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

type Operation[F comparable] interface {
	// Context returns a context, that when canceled represents a forced abort of the operation.
	Context() context.Context
	// FileKey returns the key of the file to which the operation applies.
	FileKey() F
	// WriteError sends an error to the operation. This is only used for IO errors.
	WriteError(error)
	// Exec is called by Persist to execute the operation. The provided file will have the key returned by FileKey.
	// The operation has a lock on the file during this time, and is free to make any modifications.
	Exec(f kfs.File[F])
}

type Set

type Set[F comparable, O Operation[F]] []O

func (Set[F, T]) Context

func (s Set[F, T]) Context() context.Context

func (Set[F, T]) Exec

func (s Set[F, T]) Exec(f kfs.File[F])

func (Set[F, T]) FileKey

func (s Set[F, T]) FileKey() F

func (Set[F, T]) WriteError

func (s Set[F, T]) WriteError(err error)

Jump to

Keyboard shortcuts

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