diff --git a/api.go b/api.go index ec819b9..2892cc9 100644 --- a/api.go +++ b/api.go @@ -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{ diff --git a/store_api.go b/store_api.go index 0cb2ec2..6a0d668 100644 --- a/store_api.go +++ b/store_api.go @@ -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 +) // --------------------------------------------------------