blob: 2dcfe5ee112bbaf1d3b4d128aee7de6a08e0c1bb [file] [log] [blame]
Author Namea594e632018-08-10 11:33:58 -04001/*
2 Copyright 2017 the original author or authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17package settings
18
19var debug = false
donNewtonAlphaaf229742018-09-19 13:22:00 -040020var dummy = false
donNewtonAlphac997d642018-10-17 13:22:48 -040021var mongo = false
Don Newton16520672018-11-28 14:44:42 -050022var grpc = true
donNewtonAlphac997d642018-10-17 13:22:48 -040023var mongodb = ""
Don Newton276cd1f2019-02-06 17:14:03 -050024var mongoUser = ""
25var mongoPasswd = ""
Author Namea594e632018-08-10 11:33:58 -040026
27/*
28SetDebug - sets debug setting
29*/
30func SetDebug(logDebug bool) {
31 debug = logDebug
32}
33
34/*
35GetDebug returns debug setting
36*/
37func GetDebug() bool {
38 return debug
39}
donNewtonAlphaaf229742018-09-19 13:22:00 -040040
41/*
42SetDummy sets dummy mode
43*/
44func SetDummy(dummyMode bool) {
45 dummy = dummyMode
46}
47
48/*
49GetDummy - returns the current value of dummy
50*/
51func GetDummy() bool {
52 return dummy
53}
Don Newton16520672018-11-28 14:44:42 -050054
55/*
56SetMongo - sets useMongo mode
57*/
donNewtonAlphac997d642018-10-17 13:22:48 -040058func SetMongo(useMongo bool) {
59 mongo = useMongo
60}
Don Newton16520672018-11-28 14:44:42 -050061
62/*GetMongo - returns the value of mongo
63 */
donNewtonAlphac997d642018-10-17 13:22:48 -040064func GetMongo() bool {
65 return mongo
66}
Don Newton16520672018-11-28 14:44:42 -050067
68/*
69SetMongodb - sets the connection string for mongo db used for backups
70*/
donNewtonAlphac997d642018-10-17 13:22:48 -040071func SetMongodb(connectString string) {
72 mongodb = connectString
73}
Don Newton16520672018-11-28 14:44:42 -050074
75/*
76GetMongodb - returns the connection string used for connecting to mongo db
77*/
donNewtonAlphac997d642018-10-17 13:22:48 -040078func GetMongodb() string {
79 return mongodb
80}
Don Newton16520672018-11-28 14:44:42 -050081
82/*
Don Newton276cd1f2019-02-06 17:14:03 -050083SetMongoUser - sets the connection string for mongo db used for backups
84*/
85func SetMongoUser(user string) {
86 mongoUser = user
87}
88
89/*
90GetMongoUser - returns the connection string used for connecting to mongo db
91*/
92func GetMongoUser() string {
93 return mongoUser
94}
95
96/*
97SetMongoPassword - sets the connection string for mongo db used for backups
98*/
99func SetMongoPassword(password string) {
100 mongoPasswd = password
101}
102
103/*
104GetMongoPassword - returns the connection string used for connecting to mongo db
105*/
106func GetMongoPassword() string {
107 return mongoPasswd
108}
109
110/*
Don Newton16520672018-11-28 14:44:42 -0500111SetGrpc - sets useGrpc mode
112*/
113func SetGrpc(useGrpc bool) {
114 grpc = useGrpc
115}
116
117/*
118GetGrpc - returns the value of grpc
119*/
120func GetGrpc() bool {
121 return grpc
122}