Bitcask: no way to set bitcask options using WithNew function #1

Closed
opened 2022-04-17 21:33:14 +00:00 by kayos · 1 comment
Owner

Proposed fix:

Have global bitcask options that will apply to databases initialzed using the WithNew function.

Something like this:

var DefaultBitcaskOptions []bitcask.Option

func SetDefaultBitcaskOptions(bitcaskopts ...bitcask.Option) {
	for _, opt := range bitcaskopts {
		DefaultBitcaskOptions = append(DefaultBitcaskOptions, opt)
	}
}

and then

	if len(DefaultBitcaskOptions) > 0 {
		bitcaskopts = append(bitcaskopts, DefaultBitcaskOptions...)
	}
Proposed fix: Have global bitcask options that will apply to databases initialzed using the `WithNew` function. Something like this: ```golang var DefaultBitcaskOptions []bitcask.Option func SetDefaultBitcaskOptions(bitcaskopts ...bitcask.Option) { for _, opt := range bitcaskopts { DefaultBitcaskOptions = append(DefaultBitcaskOptions, opt) } } ``` and then ```golang if len(DefaultBitcaskOptions) > 0 { bitcaskopts = append(bitcaskopts, DefaultBitcaskOptions...) } ```
Author
Owner

Fixed, SetDefaultBitcaskOptions was implemented

Fixed, SetDefaultBitcaskOptions was implemented
kayos closed this issue 2022-07-26 04:58:56 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tcp.direct/database#1
No description provided.