Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package settings |
| 18 | |
| 19 | var debug = false |
donNewtonAlpha | af22974 | 2018-09-19 13:22:00 -0400 | [diff] [blame] | 20 | var dummy = false |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 21 | var mongo = false |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame] | 22 | var grpc = true |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 23 | var mongodb = "" |
Don Newton | 276cd1f | 2019-02-06 17:14:03 -0500 | [diff] [blame] | 24 | var mongoUser = "" |
| 25 | var mongoPasswd = "" |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 26 | |
| 27 | /* |
| 28 | SetDebug - sets debug setting |
| 29 | */ |
| 30 | func SetDebug(logDebug bool) { |
| 31 | debug = logDebug |
| 32 | } |
| 33 | |
| 34 | /* |
| 35 | GetDebug returns debug setting |
| 36 | */ |
| 37 | func GetDebug() bool { |
| 38 | return debug |
| 39 | } |
donNewtonAlpha | af22974 | 2018-09-19 13:22:00 -0400 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | SetDummy sets dummy mode |
| 43 | */ |
| 44 | func SetDummy(dummyMode bool) { |
| 45 | dummy = dummyMode |
| 46 | } |
| 47 | |
| 48 | /* |
| 49 | GetDummy - returns the current value of dummy |
| 50 | */ |
| 51 | func GetDummy() bool { |
| 52 | return dummy |
| 53 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame] | 54 | |
| 55 | /* |
| 56 | SetMongo - sets useMongo mode |
| 57 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 58 | func SetMongo(useMongo bool) { |
| 59 | mongo = useMongo |
| 60 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame] | 61 | |
| 62 | /*GetMongo - returns the value of mongo |
| 63 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 64 | func GetMongo() bool { |
| 65 | return mongo |
| 66 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame] | 67 | |
| 68 | /* |
| 69 | SetMongodb - sets the connection string for mongo db used for backups |
| 70 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 71 | func SetMongodb(connectString string) { |
| 72 | mongodb = connectString |
| 73 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame] | 74 | |
| 75 | /* |
| 76 | GetMongodb - returns the connection string used for connecting to mongo db |
| 77 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 78 | func GetMongodb() string { |
| 79 | return mongodb |
| 80 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame] | 81 | |
| 82 | /* |
Don Newton | 276cd1f | 2019-02-06 17:14:03 -0500 | [diff] [blame] | 83 | SetMongoUser - sets the connection string for mongo db used for backups |
| 84 | */ |
| 85 | func SetMongoUser(user string) { |
| 86 | mongoUser = user |
| 87 | } |
| 88 | |
| 89 | /* |
| 90 | GetMongoUser - returns the connection string used for connecting to mongo db |
| 91 | */ |
| 92 | func GetMongoUser() string { |
| 93 | return mongoUser |
| 94 | } |
| 95 | |
| 96 | /* |
| 97 | SetMongoPassword - sets the connection string for mongo db used for backups |
| 98 | */ |
| 99 | func SetMongoPassword(password string) { |
| 100 | mongoPasswd = password |
| 101 | } |
| 102 | |
| 103 | /* |
| 104 | GetMongoPassword - returns the connection string used for connecting to mongo db |
| 105 | */ |
| 106 | func GetMongoPassword() string { |
| 107 | return mongoPasswd |
| 108 | } |
| 109 | |
| 110 | /* |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame] | 111 | SetGrpc - sets useGrpc mode |
| 112 | */ |
| 113 | func SetGrpc(useGrpc bool) { |
| 114 | grpc = useGrpc |
| 115 | } |
| 116 | |
| 117 | /* |
| 118 | GetGrpc - returns the value of grpc |
| 119 | */ |
| 120 | func GetGrpc() bool { |
| 121 | return grpc |
| 122 | } |