Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
coreospackage
Commits
a0baf318
Commit
a0baf318
authored
7 years ago
by
Ajit Jagtap
Browse files
Options
Downloads
Patches
Plain Diff
made a version which can run "go install"
parent
1ff6fd17
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!6
Stagingbranch
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+4
-2
.gitignore
GoGetScript.sh
+62
-62
GoGetScript.sh
cacheHelper.go
+14
-15
cacheHelper.go
configHelper.go
+10
-16
configHelper.go
glide.yaml
+1
-0
glide.yaml
with
91 additions
and
95 deletions
.gitignore
+
4
−
2
View file @
a0baf318
...
...
@@ -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
This diff is collapsed.
Click to expand it.
GoGetScript.sh
+
62
−
62
View file @
a0baf318
...
...
@@ -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
This diff is collapsed.
Click to expand it.
cacheHelper.go
+
14
−
15
View file @
a0baf318
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.
...
...
This diff is collapsed.
Click to expand it.
configHelper.go
+
10
−
16
View file @
a0baf318
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
""
}
This diff is collapsed.
Click to expand it.
glide.yaml
+
1
−
0
View file @
a0baf318
package
:
coreospackage
import
:
-
package
:
GolangFullStack/server/api/server/config
-
package
:
github.com/allegro/bigcache
-
package
:
github.com/dgrijalva/jwt-go
version
:
^3.0.0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets