Commit 98e39881 authored by Sandeep S. Shewalkar's avatar Sandeep S. Shewalkar
Browse files

Merge branch 'stagingbranch' into 'master'

Stagingbranch

See merge request !9
parents 497ad486 e411ba33
Branches
Tags
1 merge request!9Stagingbranch
Showing with 38 additions and 9 deletions
......@@ -7,15 +7,15 @@ import (
"github.com/allegro/bigcache"
)
const (
BIGCACHEShards=8
BIGCACHEMaxEntrySize=1024
BIGCACHEVerbose=true
BIGCACHEHardMaxCacheSize=0
BIGCACHEMaxEntriesInWindow=1000 10 60
BIGCACHELifeWindow=2
BIGCACHEShards = 8
BIGCACHEMaxEntrySize = 1024
BIGCACHEVerbose = true
BIGCACHEHardMaxCacheSize = 0
BIGCACHEMaxEntriesInWindow = 1000 * 10 * 60
BIGCACHELifeWindow = 2
)
var bigcacheConfig = bigcache.Config{
// number of shards (must be a power of 2)
// Shards: 4096,
......@@ -23,7 +23,7 @@ var bigcacheConfig = bigcache.Config{
// time after which entry can be evicted
LifeWindow: BIGCACHELifeWindow * time.Hour,
// rps * lifeWindow, used only in initial memory allocation
MaxEntriesInWindow: 1000 * 10 * 60,
MaxEntriesInWindow: BIGCACHEMaxEntriesInWindow,
// MaxEntriesInWindow: 10,
// max entry size in bytes, used only in initial memory allocation
MaxEntrySize: BIGCACHEMaxEntrySize,
......
package coreos
import (
"fmt"
"time"
)
//GetDataFromFDB gets data from FDB
func GetDataFromFDB(filePath string) ([]byte, error) {
data, err := ReadFile(filePath)
return data, err
}
//SaveDataToFDB saves data to FDB
func SaveDataToFDB(filePath string, data []byte) error {
err := WriteFile(filePath, data)
fmt.Println(err)
return err
}
//DeleteFileFromFDB deletes file to FDB
func DeleteFileFromFDB(filePath string) error {
newFilePath := filePath + "_deleted_" + time.Now().String()
err := RenameFile(filePath, newFilePath)
return err
}
......@@ -16,7 +16,7 @@ func GetMongoConnection() *mgo.Session {
Host := []string{
GetConfig("MONGODSN"),
}
const (
var (
Username = ""
Password = ""
Database = GetConfig("DBNAME")
......
......@@ -4,6 +4,7 @@ import (
"github.com/go-playground/locales/en"
ut "github.com/go-playground/universal-translator"
validator "gopkg.in/go-playground/validator.v9"
en_translations "gopkg.in/go-playground/validator.v9/translations/en"
)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment