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 given storage
func (*JournalPersister) PersistStream ¶
func (lp *JournalPersister) PersistStream(encC chan gob.GobEncoder) chan error
PersistStream listens to the input channel and persists entries to storage
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(gob.GobEncoder) error
PersistStream(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
type Storage ¶
type Storage interface {
// Reset deletes any data stored in the storage
Reset() error
// Writer creates a new io.WriteCloser for the storage
Writer() (io.WriteCloser, error)
// Reader creates a new io.ReadCloser for the storage
Reader() (io.ReadCloser, error)
fmt.Stringer
// contains filtered or unexported methods
}
Storage provides the underlying data store used by the persister
func NewBlobStore ¶
func NewBlobStore(cfg StoreConfig) (Storage, error)
NewBlobStore creates a new blob Storage
type StoreConfig ¶
StoreConfig - config for data store
func (StoreConfig) Storage ¶
func (cfg StoreConfig) Storage() (Storage, error)
Storage creates a new Storage based on the config