mode

package
v0.0.0-...-8ba21cc Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeMode

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

SafeMode controls whether enable safe-mode through a mechanism similar to reference-count indicates enabled excepting the count is 0.

func NewSafeMode

func NewSafeMode() *SafeMode

NewSafeMode creates a new SafeMode instance.

func (*SafeMode) Add

func (m *SafeMode) Add(tctx *tcontext.Context, n int32) error

Add adds n to the count, n can be negative.

func (*SafeMode) DescForTable

func (m *SafeMode) DescForTable(tctx *tcontext.Context, table *filter.Table) error

DescForTable tries to add -1 on the count if the table added before.

func (*SafeMode) Enable

func (m *SafeMode) Enable() bool

Enable returns whether is enabled currently.

func (*SafeMode) IncrForTable

func (m *SafeMode) IncrForTable(tctx *tcontext.Context, table *filter.Table) error

IncrForTable tries to add 1 on the count if the table not added before can only be desc with DescForTable.

func (*SafeMode) Reset

func (m *SafeMode) Reset(tctx *tcontext.Context)

Reset resets to the state of not-enable.

Jump to

Keyboard shortcuts

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