Documentation
¶
Index ¶
- func NewFlushFunc(mode FlushMode) (func(ctx context.Context, conn *driver.Conn) error, error)
- type Controller
- func (c *Controller) Flush(ctx context.Context, waitIdleDuration time.Duration, mode FlushMode) error
- func (c *Controller) MarkCleanAfterCheck()
- func (c *Controller) OnOpen(ctx context.Context) (dirty bool, err error)
- func (c *Controller) OnWriteEvent(event driver.EventType)
- func (c *Controller) Start(ctx context.Context) error
- func (c *Controller) Stop() error
- type FlushMode
- type Options
- type Sentinel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(opts Options) *Controller
func (*Controller) Flush ¶
func (c *Controller) Flush(ctx context.Context, waitIdleDuration time.Duration, mode FlushMode) error
Flush perform fsync or WAL checkpoint (depends on FlushMode) on sqlite When waitIdleDuration > 0, wait for waitIdleTime since the last write tx got released
func (*Controller) MarkCleanAfterCheck ¶ added in v0.4.1
func (c *Controller) MarkCleanAfterCheck()
MarkCleanAfterCheck marks the DB as clean after a successful integrity check. This should be called after quickcheck/integrity verification when no corruption is found.
func (*Controller) OnOpen ¶
func (c *Controller) OnOpen(ctx context.Context) (dirty bool, err error)
func (*Controller) OnWriteEvent ¶
func (c *Controller) OnWriteEvent(event driver.EventType)
func (*Controller) Stop ¶
func (c *Controller) Stop() error
type Options ¶
type Options struct {
AutoFlushEnable bool
AutoFlushIdleAfter time.Duration
AutoFlushFunc func(ctx context.Context, conn *driver.Conn) error
// AcquireWrite acquires write connection. If silent is true, won't trigger write events on release
AcquireWrite func(ctx context.Context, fn func(conn *driver.Conn) error) error
Sentinel Sentinel
Logger *log.Logger
}
Click to show internal directories.
Click to hide internal directories.