internal

package
v0.0.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

func BytesToStringUnsafe

func BytesToStringUnsafe(b []byte) string

func CreateBucket

func CreateBucket(db *bolt.DB, bucketName string) error

CreateBucket is a generic function used to create a bucket inside a bolt database.

func DeleteObject

func DeleteObject(db *bolt.DB, bucketName string, key []byte) error

DeleteObject is a generic function used to delete an object inside a bolt database.

func GetNextIdentifier

func GetNextIdentifier(db *bolt.DB, bucketName string) int

GetNextIdentifier is a generic function that returns the specified bucket identifier incremented by 1.

func GetObject

func GetObject(db *bolt.DB, bucketName string, key []byte, object interface{}) error

GetObject is a generic function used to retrieve an unmarshalled object from a bolt database.

func GetString

func GetString(db *bolt.DB, bucketName string, key []byte) (string, error)

GetString is a generic function used to retrieve an unmarshalled object from a bolt database.

func Itob

func Itob(v int) []byte

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 MD5Hash

func MD5Hash(text string) string

func MarshalObject

func MarshalObject(object interface{}) ([]byte, error)

MarshalObject encodes an object to binary format

func StringToBytes

func StringToBytes(s string) []byte

func StringToBytesUnsafe

func StringToBytesUnsafe(s string) []byte

func UnmarshalObject

func UnmarshalObject(data []byte, object interface{}) error

UnmarshalObject decodes an object from binary data

func UnmarshalObjectWithJsoniter

func UnmarshalObjectWithJsoniter(data []byte, object interface{}) error

UnmarshalObjectWithJsoniter decodes an object from binary data using the jsoniter library. It is mainly used to accelerate endpoint decoding at the moment.

func UpdateObject

func UpdateObject(db *bolt.DB, bucketName string, key []byte, object interface{}) error

UpdateObject is a generic function used to update an object inside a bolt database.

func UpdateString

func UpdateString(db *bolt.DB, bucketName string, key []byte, value []byte) error

UpdateString is a generic function used to update an object inside a bolt database.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL