Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace global var with iota const #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,29 +271,31 @@ type Event struct {
// EventKind represents an event code for OnEvent() callbacks.
type EventKind int

// EventKindCloseStart is fired when a collection.Close() has begun.
// The closing might take awhile to complete and an EventKindClose
// will follow later.
var EventKindCloseStart = EventKind(1)

// EventKindClose is fired when a collection has been fully closed.
var EventKindClose = EventKind(2)

// EventKindMergerProgress is fired when the merger has completed a
// round of merge processing.
var EventKindMergerProgress = EventKind(3)

// EventKindPersisterProgress is fired when the persister has
// completed a round of persistence processing.
var EventKindPersisterProgress = EventKind(4)

// EventKindBatchExecuteStart is fired when a collection is starting
// to execute a batch.
var EventKindBatchExecuteStart = EventKind(5)

// EventKindBatchExecute is fired when a collection has finished
// executing a batch.
var EventKindBatchExecute = EventKind(6)
const (
// EventKindCloseStart is fired when a collection.Close() has begun.
// The closing might take awhile to complete and an EventKindClose
// will follow later.
EventKindCloseStart EventKind = 1 + iota

// EventKindClose is fired when a collection has been fully closed.
EventKindClose

// EventKindMergerProgress is fired when the merger has completed a
// round of merge processing.
EventKindMergerProgress

// EventKindPersisterProgress is fired when the persister has
// completed a round of persistence processing.
EventKindPersisterProgress

// EventKindBatchExecuteStart is fired when a collection is starting
// to execute a batch.
EventKindBatchExecuteStart

// EventKindBatchExecute is fired when a collection has finished
// executing a batch.
EventKindBatchExecute
)

// DefaultCollectionOptions are the default configuration options.
var DefaultCollectionOptions = CollectionOptions{
Expand Down
16 changes: 9 additions & 7 deletions store_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,17 @@ type StorePersistOptions struct {
// behaviors associated with persistence.
type CompactionConcern int

// CompactionDisable means no compaction.
var CompactionDisable = CompactionConcern(0)
const (
// CompactionDisable means no compaction.
CompactionDisable CompactionConcern = iota

// CompactionAllow means compaction decision is automated and based on
// the configed policy and parameters, such as CompactionPercentage.
var CompactionAllow = CompactionConcern(1)
// CompactionAllow means compaction decision is automated and based on
// the configed policy and parameters, such as CompactionPercentage.
CompactionAllow

// CompactionForce means compaction should be performed immediately.
var CompactionForce = CompactionConcern(2)
// CompactionForce means compaction should be performed immediately.
CompactionForce
)

// --------------------------------------------------------

Expand Down