filepack

package
v2.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// IndexKeyValSeperator -
	IndexKeyValSeperator = "="
	// FileType - represents key for type of file. Used whenever we need to set file type field in json
	FileType = "fileType"
)

Variables

View Source
var ErrNoDataFound = errors.New("No data found")

ErrNoDataFound - ErrNoDataFound

Functions

func AddFileInPackFile

func AddFileInPackFile(filePath string, infileIndexFields []InFileIndexField, rs *gjson.Result, secParams securitymdl.FDBSecParams) error

AddFileInPackFile -

func AddFileInPackFileUsingFp

func AddFileInPackFileUsingFp(f *os.File, infileIndexFields []InFileIndexField, rs *gjson.Result, secParams securitymdl.FDBSecParams) error

AddFileInPackFileUsingFp -

func AddMediaInPackFile

func AddMediaInPackFile(filePath string, mediaData []byte, infileIndexFields []InFileIndexField, rs *gjson.Result) (string, error)

AddMediaInPackFile -

func AddMediaInPackFileUsingFp

func AddMediaInPackFileUsingFp(f *os.File, infileIndex *gjson.Result, mediaData []byte, infileIndexFields []InFileIndexField, rs *gjson.Result) (string, *gjson.Result, error)

AddMediaInPackFileUsingFp - AddMediaInPackFileUsingFp

func AddPackFileUsingFp

func AddPackFileUsingFp(f *os.File, infileIndexFields []InFileIndexField, infileIndex, rs *gjson.Result, secParams securitymdl.FDBSecParams) (infileIndexData *gjson.Result, err error)

AddPackFileUsingFp -

func CreateIndexJSON

func CreateIndexJSON(indexFields []InFileIndexField, rs *gjson.Result) (string, error)

func DeletDataFromPackFile

func DeletDataFromPackFile(filePath string, infileIndexQueries []string) (int, error)

DeletDataFromPackFile -DeletDataFromPackFile

func DeletDataFromPackFileUsingFp

func DeletDataFromPackFileUsingFp(f *os.File, infileIndex *gjson.Result, infileIndexQueries []string) (int, *gjson.Result, error)

DeletDataFromPackFileUsingFp -DeletDataFromPackFileUsingFp

func GetDataFromPackFile

func GetDataFromPackFile(filePath string, inFileIndexQueries []string, rs *gjson.Result, secParams securitymdl.FDBSecParams) (string, error)

GetDataFromPackFile - GetDataFromPackFile

func GetDataFromPackFileUsingFp

func GetDataFromPackFileUsingFp(f *os.File, infileIndexData *gjson.Result, inFileIndexQueries []string, rs *gjson.Result, secParams securitymdl.FDBSecParams) (string, *gjson.Result, error)

GetDataFromPackFileUsingFp - GetDataFromPackFileUsingFp

func GetKeyWithFileNameAndDefaultKey

func GetKeyWithFileNameAndDefaultKey(filePath string) ([]byte, error)

GetKeyWithFileNameAndDefaultKey generates key using file name + Default key

func GetMediaFromPackFile

func GetMediaFromPackFile(filePath string, recordID string) ([]byte, gjson.Result, error)

GetMediaFromPackFile - GetMediaFromPackFile

func GetMediaFromPackFileUsingFp

func GetMediaFromPackFileUsingFp(f *os.File, infileIndex *gjson.Result, recordID string) ([]byte, *gjson.Result, error)

GetMediaFromPackFileUsingFp - GetMediaFromPackFileUsingFp

func Init

func Init(isSecurityRequired, isCompressionRequired bool, securityKey string)

Init - initializes pack config

func ReorgPackFile

func ReorgPackFile(filePath string) error

func UpdateFileInPackFileUsingFp

func UpdateFileInPackFileUsingFp(f *os.File, infileIndexQueries []string, infileIndex, rs *gjson.Result, secParams securitymdl.FDBSecParams) (*gjson.Result, *gjson.Result, error)

UpdateFilesInPackFileUsingFp - UpdateFilesInPackFileUsingFp

func UpdateFilesInPackFile

func UpdateFilesInPackFile(filePath string, infileIndexQueries []string, rs *gjson.Result, secParams securitymdl.FDBSecParams) (*gjson.Result, error)

UpdateFilesInPackFile - UpdateFilesInPackFile

func UpdateMediaInPackFile

func UpdateMediaInPackFile(filePath string, recordID string, mediaData []byte, infileIndexFields []InFileIndexField, rs *gjson.Result) (string, error)

UpdateMediaInPackFile - UpdateMediaInPackFile

func UpdateMediaInPackFileUsingFp

func UpdateMediaInPackFileUsingFp(f *os.File, infileIndex *gjson.Result, recordID string, mediaData []byte, infileIndexFields []InFileIndexField, rs *gjson.Result) (string, *gjson.Result, error)

UpdateMediaInPackFileUsingFp - UpdateMediaInPackFileUsingFp

func UpsertMediaInPackFileUsingFp

func UpsertMediaInPackFileUsingFp(f *os.File, infileIndex *gjson.Result, recordID string, mediaData []byte, infileIndexFields []InFileIndexField, rs *gjson.Result) (string, *gjson.Result, error)

UpsertMediaInPackFileUsingFp - UpsertMediaInPackFileUsingFp

Types

type InFileIndex

type InFileIndex struct {
	FileType    string             `json:"fileType"`
	IndexFields []InFileIndexField `json:"indexFields"`
}

InFileIndex -

type InFileIndexField

type InFileIndexField struct {
	FieldName string `json:"fieldName"`
	Query     string `json:"query"`
}

InFileIndexField - InFileIndexField

Jump to

Keyboard shortcuts

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