diff --git a/.gitignore b/.gitignore index 7d03aec378b08ad74a87ff8f5ca30374cbc1341d..d8ad6bd5253033b57502d718038fa91e2870551f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ *.a *.so -InstallLogs.txt +*.txt # Folders _obj @@ -23,4 +23,6 @@ _testmain.go *.exe *.test -*.bench \ No newline at end of file +*.bench + +vendor \ No newline at end of file diff --git a/GoGetScript.sh b/GoGetScript.sh index db1b359fe7159dc117db41ea0252a3fb7a976383..950d3f0da2ab50ca816a1ed2fcf38758110b42c5 100755 --- a/GoGetScript.sh +++ b/GoGetScript.sh @@ -5,25 +5,25 @@ NOW=$(date +"%d-%b-%Y %H:%M:%S") echo $NOW " : Installed \"github.com/allegro/bigcache\"" >> InstallLogs.txt -# echo "Installing : \"github.com/spf13/viper\"" -# go get "github.com/spf13/viper" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"github.com/spf13/viper\"" >> InstallLogs.txt +echo "Installing : \"github.com/spf13/viper\"" +go get "github.com/spf13/viper" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"github.com/spf13/viper\"" >> InstallLogs.txt -# echo "Installing : \"github.com/gocraft/dbr\"" -# go get "github.com/gocraft/dbr" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"github.com/gocraft/dbr\"" >> InstallLogs.txt +echo "Installing : \"github.com/gocraft/dbr\"" +go get "github.com/gocraft/dbr" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"github.com/gocraft/dbr\"" >> InstallLogs.txt -# echo "Installing : \"gopkg.in/mgo.v2\"" -# go get "gopkg.in/mgo.v2" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"gopkg.in/mgo.v2\"" >> InstallLogs.txt +echo "Installing : \"gopkg.in/mgo.v2\"" +go get "gopkg.in/mgo.v2" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"gopkg.in/mgo.v2\"" >> InstallLogs.txt echo "Installing : \"github.com/garyburd/redigo/redis\"" @@ -33,25 +33,25 @@ NOW=$(date +"%d-%b-%Y %H:%M:%S") echo $NOW " : Installed \"github.com/garyburd/redigo/redis\"" >> InstallLogs.txt -# echo "Installing : \"github.com/stretchr/testify/assert\"" -# go get "github.com/stretchr/testify/assert" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"github.com/stretchr/testify/assert\"" >> InstallLogs.txt +echo "Installing : \"github.com/stretchr/testify/assert\"" +go get "github.com/stretchr/testify/assert" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"github.com/stretchr/testify/assert\"" >> InstallLogs.txt -# echo "Installing : \"github.com/labstack/echo\"" -# go get "github.com/labstack/echo" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"github.com/labstack/echo\"" >> InstallLogs.txt +echo "Installing : \"github.com/labstack/echo\"" +go get "github.com/labstack/echo" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"github.com/labstack/echo\"" >> InstallLogs.txt -# echo "Installing : \"gopkg.in/mgo.v2/bson\"" -# go get "gopkg.in/mgo.v2/bson" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"gopkg.in/mgo.v2/bson\"" >> InstallLogs.txt +echo "Installing : \"gopkg.in/mgo.v2/bson\"" +go get "gopkg.in/mgo.v2/bson" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"gopkg.in/mgo.v2/bson\"" >> InstallLogs.txt echo "Installing : \"github.com/dgrijalva/jwt-go\"" @@ -61,32 +61,32 @@ NOW=$(date +"%d-%b-%Y %H:%M:%S") echo $NOW " : Installed \"github.com/dgrijalva/jwt-go\"" >> InstallLogs.txt -# echo "Installing : \"github.com/labstack/echo/middleware\"" -# go get "github.com/labstack/echo/middleware" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"github.com/labstack/echo/middleware\"" >> InstallLogs.txt +echo "Installing : \"github.com/labstack/echo/middleware\"" +go get "github.com/labstack/echo/middleware" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"github.com/labstack/echo/middleware\"" >> InstallLogs.txt -# echo "Installing : \"github.com/sirupsen/logrus\"" -# go get "github.com/sirupsen/logrus" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"github.com/sirupsen/logrus\"" >> InstallLogs.txt +echo "Installing : \"github.com/sirupsen/logrus\"" +go get "github.com/sirupsen/logrus" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"github.com/sirupsen/logrus\"" >> InstallLogs.txt -# echo "Installing : \"github.com/go-playground/locales/en\"" -# go get "github.com/go-playground/locales/en" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"github.com/go-playground/locales/en\"" >> InstallLogs.txt +echo "Installing : \"github.com/go-playground/locales/en\"" +go get "github.com/go-playground/locales/en" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"github.com/go-playground/locales/en\"" >> InstallLogs.txt -# echo "Installing : \"gopkg.in/go-playground/validator.v9\"" -# go get "gopkg.in/go-playground/validator.v9" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"gopkg.in/go-playground/validator.v9\"" >> InstallLogs.txt +echo "Installing : \"gopkg.in/go-playground/validator.v9\"" +go get "gopkg.in/go-playground/validator.v9" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"gopkg.in/go-playground/validator.v9\"" >> InstallLogs.txt echo "Installing : \"github.com/go-playground/universal-translator\"" @@ -96,17 +96,17 @@ NOW=$(date +"%d-%b-%Y %H:%M:%S") echo $NOW " : Installed \"github.com/go-playground/universal-translator\"" >> InstallLogs.txt -# echo "Installing : \"gopkg.in/go-playground/validator.v9/translations/en\"" -# go get "gopkg.in/go-playground/validator.v9/translations/en" -# echo "Done" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo $NOW " : Installed \"gopkg.in/go-playground/validator.v9/translations/en\"" >> InstallLogs.txt +echo "Installing : \"gopkg.in/go-playground/validator.v9/translations/en\"" +go get "gopkg.in/go-playground/validator.v9/translations/en" +echo "Done" +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo $NOW " : Installed \"gopkg.in/go-playground/validator.v9/translations/en\"" >> InstallLogs.txt -# echo "******************************************" -# echo "Installation complete" -# echo "******************************************" +echo "******************************************" +echo "Installation complete" +echo "******************************************" -# NOW=$(date +"%d-%b-%Y %H:%M:%S") -# echo "******************************************" >> InstallLogs.txt -# echo $NOW "Installation complete" >> InstallLogs.txt -# echo "******************************************" >> InstallLogs.txt \ No newline at end of file +NOW=$(date +"%d-%b-%Y %H:%M:%S") +echo "******************************************" >> InstallLogs.txt +echo $NOW "Installation complete" >> InstallLogs.txt +echo "******************************************" >> InstallLogs.txt \ No newline at end of file diff --git a/cacheHelper.go b/cacheHelper.go index 7a71625a1a33116511af67524a559e87f4e50b2a..0200bc27651293373e216ef15fa0b72277157ea3 100644 --- a/cacheHelper.go +++ b/cacheHelper.go @@ -1,7 +1,6 @@ package coreos import ( - "GolangFullStack/server/api/server/config" "fmt" "time" @@ -11,20 +10,20 @@ import ( var bigcacheConfig = bigcache.Config{ // number of shards (must be a power of 2) // Shards: 4096, - Shards: config.BIGCACHEShards, - // time after which entry can be evicted - LifeWindow: config.BIGCACHELifeWindow * time.Hour, - // rps * lifeWindow, used only in initial memory allocation - MaxEntriesInWindow: 1000 * 10 * 60, - // MaxEntriesInWindow: 10, - // max entry size in bytes, used only in initial memory allocation - MaxEntrySize: config.BIGCACHEMaxEntrySize, - // prints information about additional memory allocation - Verbose: config.BIGCACHEVerbose, - // cache will not allocate more memory than this limit, value in MB - // if value is reached then the oldest entries can be overridden for the new ones - // 0 value means no size limit - HardMaxCacheSize: config.BIGCACHEHardMaxCacheSize, + // Shards: config.BIGCACHEShards, + // // time after which entry can be evicted + // LifeWindow: config.BIGCACHELifeWindow * time.Hour, + // // rps * lifeWindow, used only in initial memory allocation + // MaxEntriesInWindow: 1000 * 10 * 60, + // // MaxEntriesInWindow: 10, + // // max entry size in bytes, used only in initial memory allocation + // MaxEntrySize: config.BIGCACHEMaxEntrySize, + // // prints information about additional memory allocation + // Verbose: config.BIGCACHEVerbose, + // // cache will not allocate more memory than this limit, value in MB + // // if value is reached then the oldest entries can be overridden for the new ones + // // 0 value means no size limit + // HardMaxCacheSize: config.BIGCACHEHardMaxCacheSize, // callback fired when the oldest entry is removed because of its // expiration time or no space left for the new entry. Default value is nil which // means no callback and it prevents from unwrapping the oldest entry. diff --git a/configHelper.go b/configHelper.go index e9a2ed71d8fc3723479ca7dbf680fe85051dbf5b..214cb1a9c4f82b00abb86157982e4f7c7d2d503e 100644 --- a/configHelper.go +++ b/configHelper.go @@ -1,27 +1,21 @@ package coreos -import ( - "fmt" - - "github.com/spf13/viper" -) - //InitViper function to initialize viper func InitViper() { - viper.SetConfigName("config") // name of config file (without extension) - viper.AddConfigPath(".") // optionally look for config in the working directory - err := viper.ReadInConfig() - // Find and read the config file - if err != nil { // Handle errors reading the config file - panic(fmt.Errorf("Fatal error config file %s ", err)) - } + // viper.SetConfigName("config") // name of config file (without extension) + // viper.AddConfigPath(".") // optionally look for config in the working directory + // err := viper.ReadInConfig() + // // Find and read the config file + // if err != nil { // Handle errors reading the config file + // panic(fmt.Errorf("Fatal error config file %s ", err)) + // } } //GetConfig method to get configs from config file func GetConfig(keyName string) string { - keyValue := viper.GetString(keyName) - - return keyValue + // keyValue := viper.GetString(keyName) + // return keyValue + return "" } diff --git a/glide.yaml b/glide.yaml index 225499b1d19d9be441e5ec8992dd9989214e6793..01eea14faac1cfc181df2536e21c042df2b9dd30 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,5 +1,6 @@ package: coreospackage import: +- package: GolangFullStack/server/api/server/config - package: github.com/allegro/bigcache - package: github.com/dgrijalva/jwt-go version: ^3.0.0