Documentation
¶
Overview ¶
Package codec contains sub-packages with different codecs that can be used to encode and decode entities in Storm.
Example ¶
package main
import (
"fmt"
"github.com/chikamif/storm"
"github.com/chikamif/storm/codec/gob"
"github.com/chikamif/storm/codec/json"
)
func main() {
// The examples below show how to set up all the codecs shipped with Storm.
// Proper error handling left out to make it simple.
var gobDb, _ = storm.Open("gob.db", storm.Codec(gob.Codec))
var jsonDb, _ = storm.Open("json.db", storm.Codec(json.Codec))
fmt.Printf("%T\n", gobDb.Codec())
fmt.Printf("%T\n", jsonDb.Codec())
}
Output: *gob.gobCodec *json.jsonCodec
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gob contains a codec to encode and decode entities in Gob format
|
Package gob contains a codec to encode and decode entities in Gob format |
|
Package json contains a codec to encode and decode entities in JSON format
|
Package json contains a codec to encode and decode entities in JSON format |
Click to show internal directories.
Click to hide internal directories.