Documentation
¶
Index ¶
- func NewFlushFunc(mode FlushMode) (func(ctx context.Context, db *btree.DB) 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()
- 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 checkpoint on the btree database When waitIdleDuration > 0, wait for waitIdleTime since the last write tx got released
func (*Controller) MarkCleanAfterCheck ¶
func (c *Controller) MarkCleanAfterCheck()
MarkCleanAfterCheck marks the DB as clean after a successful integrity check.
func (*Controller) OnOpen ¶
func (c *Controller) OnOpen(ctx context.Context) (dirty bool, err error)
func (*Controller) OnWriteEvent ¶
func (c *Controller) OnWriteEvent()
func (*Controller) Stop ¶
func (c *Controller) Stop() error
type Options ¶
type Options struct {
AutoFlushEnable bool
AutoFlushIdleAfter time.Duration
AutoFlushFunc func(ctx context.Context, db *btree.DB) error
// AcquireWrite acquires write access to the database
AcquireWrite func(ctx context.Context, fn func(db *btree.DB) error) error
Sentinel Sentinel
Logger *log.Logger
}
Click to show internal directories.
Click to hide internal directories.