Documentation ¶
Index ¶
- Constants
- Variables
- func AddIndexEntriesInFile(indexFilePath string, entries map[string]string, ...) error
- func DeleteDataFromFDB(dbName, indexID string, rs *gjson.Result, queries []string, ...) (recordsDeletedCnt int, errList []error)
- func GenRowID(name string) (string, error)
- func GetFilePaths(dbName, indexID string, queries []string) ([]string, error)
- func GetMediaFromFDB(dbName, indexID string, rowID, recordID string) (dataByte []byte, fileMeta gjson.Result, err error)
- func ImportIndexEntries(indexFilePath string, fdb *FDB, indexID string) error
- func ReadDataFromFDB(dbName, indexID string, data *gjson.Result, queries []string, ...) (*gjson.Result, error)
- func ReorganizeFDBBucketData(dbName, indexId string, queries []string) (errList []error)
- func ReorganizeFiles(dbName string) (errList []error)
- func SaveDataInFDB(dbName string, indexID string, data *gjson.Result) error
- func SaveMediaInFDB(dbName, indexID string, mediaData []byte, data *gjson.Result) (recordPath string, err error)
- func UpdateDataInFDB(dbName, indexID string, data *gjson.Result, queries []string, ...) (*gjson.Result, []error)
- func UpdateMediaInFDB(dbName, indexID, recordID string, mediaData []byte, rs *gjson.Result) (string, error)
- func UpsertMediaInFDB(dbName, indexID, recordID string, mediaData []byte, rs *gjson.Result) (string, error)
- type FDB
- func (fdb *FDB) AddBucket(bucketID string, bucketObj bucket.Store) error
- func (fdb *FDB) EnableFDBSecurity(sec bool)
- func (f *FDB) GetFDBBucketStore(bucketID string) (bucket.Store, bool)
- func (f *FDB) GetFDBIndex(indexID string) (*index.Index, bool)
- func (fdb *FDB) RegisterNewIndex(indexID, indexNameQuery string, isDynamicName bool, ...) (*index.Index, error)
- func (fdb *FDB) ResolvePath(index *index.Index, rs *gjson.Result) (string, error)
- func (fdb *FDB) SetSecurityProvider(securityProvider securityprovider.SecurityProvider) error
- type FileExporter
- type FileImporter
- type ZipExporter
- type ZipImporter
Constants ¶
const ( // INDEXFOLDER -INDEXFOLDER INDEXFOLDER = "index" // LazyCallBackFnAppendBucket - LazyCallBackFnAppendBucket LazyCallBackFnAppendBucket = "LazyWriterAppendBucketCallBackFn" // LazyCallBackFnSaveIndex - LazyCallBackFnSaveIndex LazyCallBackFnSaveIndex = "LazyWriterCallBackFnAppendBucketSaveIndex" IndexKeyValSeperator = "=" FileType = "fileType" MigrationTypeUpdate = "MigrationTypeUpdate" MigrationTypeReplace = "MigrationTypeReplace" MigrationTypeKeyword = "migrationType" MigrationConfigFilename = "migrationConfig" PathSeperator = "/" )
Variables ¶
ErrNoDataFound - This error describes that the required data might be deleted and not found. Kindly ignore this error in caller.
var IsDebugModeOn bool
Functions ¶
func AddIndexEntriesInFile ¶
func AddIndexEntriesInFile(indexFilePath string, entries map[string]string, securityProvider securityprovider.SecurityProvider) error
AddIndexEntriesInFile -AddIndexEntriesInFile
func DeleteDataFromFDB ¶
func GenRowID ¶
GenRowID generates hash for the given filename. The length of hash is 16
func GetMediaFromFDB ¶
func ImportIndexEntries ¶
ImportIndexEntries -
func ReadDataFromFDB ¶
func ReorganizeFDBBucketData ¶
func SaveMediaInFDB ¶
func UpdateDataInFDB ¶
func UpdateMediaInFDB ¶
Types ¶
type FDB ¶
type FDB struct { DBName string DBPath string `json:"dbPath"` EnableSecurity bool `json:"enableSec"` // if enabled, fdb files will be encrypted EnableCompression bool `json:"enableCmp"` // if enabled, fdb files will be compressed and then encrypted // contains filtered or unexported fields }
FDB - FDB
func CreateFDBInstance ¶
CreateFDBInstance - creates fdb instance
func GetFDBInstance ¶
GetFDBInstance - returns fdb instance
func (*FDB) EnableFDBSecurity ¶
EnableFDBSecurity enables security. Files will be encrypted.
func (*FDB) GetFDBBucketStore ¶
GetFDBBucketStore - returns bucket
func (*FDB) GetFDBIndex ¶
GetFDBIndex - returns index
func (*FDB) RegisterNewIndex ¶
func (fdb *FDB) RegisterNewIndex(indexID, indexNameQuery string, isDynamicName bool, indexFields []index.IndexField) (*index.Index, error)
RegisterNewIndex - RegisterNewIndex returns new index
func (*FDB) ResolvePath ¶
func (*FDB) SetSecurityProvider ¶
func (fdb *FDB) SetSecurityProvider(securityProvider securityprovider.SecurityProvider) error
type FileExporter ¶
type FileExporter struct { FdbName string IndexID string Queries []string DestPath string MigrationType string }
FileExporter is a DataExporter allow to export fdb data in a folder
func (FileExporter) DataExport ¶
func (f FileExporter) DataExport() (err error)
DataExport exports fdb data in a folder
type FileImporter ¶
FileImporter is a DataImporter allow to import fdb data from exported folder
func (FileImporter) DataImport ¶
func (f FileImporter) DataImport() (err error)
DataImport imports data from exported folder
type ZipExporter ¶
type ZipExporter struct { FdbName string IndexID string Queries []string DestPath string MigrationType string }
ZipExporter is a DataExporter allow to export fdb data as zip
func (ZipExporter) DataExport ¶
func (z ZipExporter) DataExport() (err error)
DataExport exports fdb data as zip