Files

18 lines
364 B
Go

package domain
import "io"
// Sink defines the contract for a storage sink that supports atomic two-phase writes.
type Sink interface {
Begin(key string) (SinkTx, error)
List(prefix string) ([]string, error)
Remove(key string) error
}
// SinkTx represents an in-progress write transaction.
type SinkTx interface {
io.Writer
Commit() error
Abort() error
}