Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oneofone/dbcl
https://github.com/oneofone/dbcl
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/oneofone/dbcl
- Owner: OneOfOne
- License: apache-2.0
- Created: 2017-04-27T19:20:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-27T22:19:53.000Z (over 7 years ago)
- Last Synced: 2024-06-21T02:04:29.663Z (5 months ago)
- Language: Go
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dbcl [![GoDoc](http://godoc.org/github.com/OneOfOne/dbcl?status.svg)](http://godoc.org/github.com/OneOfOne/dbcl) [![Build Status](https://travis-ci.org/OneOfOne/dbcl.svg?branch=master)](https://travis-ci.org/OneOfOne/dbcl)
--dbcl a simple, efficient, typed memory caching layer.
## Install
go get github.com/OneOfOne/dbcl
## Usage
```go
import (
"github.com/OneOfOne/dbcl"
"github.com/OneOfOne/backend/boltCL"
)func main() {
be, err := boltCL.New(path, mode, boltOpts)
if err != nil {
log.Fatal(err)
}db, err := dbcl.New(&dbcl.Options{
DefaultMarshalFn: json.Marshal,
DefaultUnmarshalFn: json.Unmarshal,
BucketMapping: []dbcl.BucketMapping{
{Name: "raw", MarshalFn: dbcl.MarshalRaw, UnmarshalFn: dbcl.UnmarshalRaw},
},
}, be)if err != nil {
log.Fatal(err)
}
defer db.Close()db.Update(func(tx *dbcl.Tx) error {
tx.Bucket("default").Set("struct", DataStruct{"hi", 100})
tx.Bucket("raw").Set("string", "string")
return nil
}
}
```## Benchmark
```bash```
## License
Apache v2.0 (see [LICENSE](https://github.com/OneOfOne/dbcl/blob/master/LICENSE) file).
Copyright 2016-2016 Ahmed <[OneOfOne](https://github.com/OneOfOne/)> W.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.