persist

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

func (*Memory) Close

func (s *Memory) Close() error

func (*Memory) Range

func (s *Memory) Range(_ context.Context, cb PersistCallbackFn) error

func (*Memory) Store

type PersistCallbackFn

type PersistCallbackFn func(d hitlist.Domain, r hitlist.Recipient, vr validator.Result) error

type Persister

type Persister interface {

	// Store stores the parts and vr. The implementation decides what key to use, although it should use a similar one
	// use to restore data using the Get or Range implementations
	Store(ctx context.Context, d hitlist.Domain, r hitlist.Recipient, vr validator.Result) error

	// Range reads all data back and invokes the callback, until all data is read back, or until the callback returns
	// a non-nil error. The implementation decides on the most optimal strategy.
	Range(ctx context.Context, cb PersistCallbackFn) error

	io.Closer
}

func New

func New(db *sql.DB, logger logrus.FieldLogger) Persister

func NewMemory

func NewMemory() Persister

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func (*Postgres) Close

func (p *Postgres) Close() error

func (*Postgres) Range

func (p *Postgres) Range(ctx context.Context, cb PersistCallbackFn) error

func (*Postgres) Store

Jump to

Keyboard shortcuts

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