NewBitmap function initializes a new BitmapStructure with the provided options
(options config.Options)
| 38 | |
| 39 | // NewBitmap function initializes a new BitmapStructure with the provided options |
| 40 | func NewBitmap(options config.Options) (*BitmapStructure, error) { |
| 41 | // Create a new database with the provided options |
| 42 | db, err := engine.NewDB(options) |
| 43 | if err != nil { |
| 44 | return nil, err |
| 45 | } |
| 46 | // Return a new BitmapStructure with the created database |
| 47 | return &BitmapStructure{db: db}, nil |
| 48 | } |
| 49 | |
| 50 | // SetBit function sets a bit at the specified offset in the bitmap for the provided key |
| 51 | func (b *BitmapStructure) SetBit(k string, off uint) error { |