Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
key-storage-agent
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
key-storage-agent
Merge requests
!11
Resolve "Implement Viper configuration"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Implement Viper configuration"
6-Implement_Viper_configuration
into
master
Overview
0
Commits
1
Pipelines
0
Changes
5
Merged
Olgun Cengiz
requested to merge
6-Implement_Viper_configuration
into
master
6 years ago
Overview
0
Commits
1
Pipelines
0
Changes
5
Expand
Closes
#6 (closed)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
3182e91a
1 commit,
6 years ago
5 files
+
52
−
11
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
server/configs.go
0 → 100644
+
29
−
0
Options
package
server
import
(
"log"
"github.com/spf13/viper"
)
func
SetConfigValues
()
{
// Set Default Values For Config Variables
// Vereign API Related
viper
.
SetDefault
(
"grpcClientUrl"
,
"localhost:7877"
)
viper
.
SetDefault
(
"restClientUrl"
,
"localhost:7878"
)
viper
.
SetDefault
(
"dataStorageClientUrl"
,
"localhost:7777"
)
// Certificates Related
viper
.
SetDefault
(
"certDir"
,
"cert"
)
viper
.
SetDefault
(
"certFile"
,
"server.crt"
)
viper
.
SetDefault
(
"certKey"
,
"server.key"
)
viper
.
SetDefault
(
"vereignCertFile"
,
"vereign_ca.cer"
)
viper
.
SetDefault
(
"vereignCertKey"
,
"vereign_ca.key"
)
// Read Config File
viper
.
SetConfigName
(
"config"
)
viper
.
AddConfigPath
(
"."
)
if
err
:=
viper
.
ReadInConfig
();
err
!=
nil
{
log
.
Printf
(
"can't read config: %s, will use default values"
,
err
)
}
}
\ No newline at end of file
Loading