Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JournalPersister ¶
type JournalPersister struct {
// contains filtered or unexported fields
}
JournalPersister saves data in an embedded Journal store
func (*JournalPersister) Finalize ¶
func (lp *JournalPersister) Finalize()
Finalize tells persister that it can finalize and close writes It is an error to send new items to persist once Finalize has been called
func (*JournalPersister) Persist ¶
func (lp *JournalPersister) Persist(enc gob.GobEncoder) error
Persist stores an entry to disk
func (*JournalPersister) PersistStream ¶
func (lp *JournalPersister) PersistStream(encC chan gob.GobEncoder) chan error
PersistStream listens to the input channel and persists entries to disk
func (*JournalPersister) Recover ¶
func (lp *JournalPersister) Recover() (chan []byte, error)
Recover reads back persisted data and emits entries
func (*JournalPersister) ResetDataDir ¶
func (lp *JournalPersister) ResetDataDir() error
ResetDataDir tells persister to *delete* everything in the datadir
type Persister ¶
type Persister interface { ResetDataDir() error Persist(enc gob.GobEncoder) error PersistStream(encC chan gob.GobEncoder) chan error Finalize() Recover() (chan []byte, error) }
Persister saves the data given to it to a durable data store like a disk, S3 buckets, durable streams etc
func NewJournalPersister ¶
NewJournalPersister initializes a Journal backed persister
Click to show internal directories.
Click to hide internal directories.