Documentation ¶
Index ¶
- Variables
- func CreateBucket(db *bolt.DB, bucketName string) error
- func DeleteObject(db *bolt.DB, bucketName string, key []byte) error
- func GetNextIdentifier(db *bolt.DB, bucketName string) int
- func GetObject(db *bolt.DB, bucketName string, key []byte, object interface{}) error
- func Itob(v int) []byte
- func MarshalObject(object interface{}) ([]byte, error)
- func UnmarshalObject(data []byte, object interface{}) error
- func UpdateObject(db *bolt.DB, bucketName string, key []byte, object interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStorageObjectNotFound = errors.New("object not found")
)
Functions ¶
func CreateBucket ¶
CreateBucket is a generic function used to create a bucket inside a bolt database.
func DeleteObject ¶
DeleteObject is a generic function used to delete an object inside a bolt database.
func GetNextIdentifier ¶
GetNextIdentifier is a generic function that returns the specified bucket identifier incremented by 1.
func GetObject ¶
GetObject is a generic function used to retrieve an unmarshalled object from a bolt database.
func Itob ¶
Itob returns an 8-byte big endian representation of v. This function is typically used for encoding integer IDs to byte slices so that they can be used as BoltDB keys.
func MarshalObject ¶
MarshalObject encodes an object to binary format
func UnmarshalObject ¶
UnmarshalObject decodes an object from binary data
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.