Code Review
/
ric-plt
/
xapp-frame.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Use payloadLen if provided
[ric-plt/xapp-frame.git]
/
pkg
/
xapp
/
config.go
diff --git
a/pkg/xapp/config.go
b/pkg/xapp/config.go
index
c63e32c
..
1f90a1a
100755
(executable)
--- a/
pkg/xapp/config.go
+++ b/
pkg/xapp/config.go
@@
-24,6
+24,7
@@
import (
"github.com/fsnotify/fsnotify"
"github.com/spf13/viper"
"os"
"github.com/fsnotify/fsnotify"
"github.com/spf13/viper"
"os"
+ "path/filepath"
)
type Configurator struct {
)
type Configurator struct {
@@
-41,8
+42,8
@@
func parseCmd() string {
return *fileName
}
return *fileName
}
-func LoadConfig() (l Log) {
- l =
Log{}
+func LoadConfig() (l
*
Log) {
+ l =
NewLogger(filepath.Base(os.Args[0]))
viper.SetConfigFile(parseCmd())
if err := viper.ReadInConfig(); err != nil {
viper.SetConfigFile(parseCmd())
if err := viper.ReadInConfig(); err != nil {
@@
-79,3
+80,11
@@
func (*Configurator) GetString(key string) string {
func (*Configurator) GetInt(key string) int {
return viper.GetInt(key)
}
func (*Configurator) GetInt(key string) int {
return viper.GetInt(key)
}
+
+func (*Configurator) GetUint32(key string) uint32 {
+ return viper.GetUint32(key)
+}
+
+func (*Configurator) GetBool(key string) bool {
+ return viper.GetBool(key)
+}