Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound indicates object is not in database.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface {
Decode(interface{}) error
}
Decoder is used to decode objects
type Encoder ¶
type Encoder interface {
Encode(interface{}) error
}
Encoder is used to encode objects
type JSONCodec ¶
type JSONCodec struct{}
JSONCodec is used to encode/decode JSON
func (JSONCodec) NewDecoder ¶
NewDecoder returns a new json decoder which reads from r
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages objects persistance.
func NewCustomStore ¶
NewCustomStore allows you to create a store with a custom underlying Encoding
func NewJSONStore ¶
NewJSONStore creates a new Store, using the underlying bolt.DB "bucket" to persist objects as json.
func NewStore ¶
NewStore creates a new Store, using the underlying bolt.DB "bucket" to persist objects. NewStore uses JSONEncoding to encode objects
func NewXMLStore ¶
NewXMLStore creates a new Store, using the underlying bolt.DB "bucket" to persist objects as xml.
func (*Store) ForEach ¶
ForEach will run do on each object in the store. do must be a function which takes exactly one parameter, which is decodeable.
type XMLCodec ¶
type XMLCodec struct{}
XMLCodec is used to encode/decode XML
func (XMLCodec) NewDecoder ¶
NewDecoder returns a new xml decoder which reads from r