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 = "" |
Author Name | a594e63 | 2018-08-10 11:33:58 -0400 | [diff] [blame] | 24 | |
| 25 | /* |
| 26 | SetDebug - sets debug setting |
| 27 | */ |
| 28 | func SetDebug(logDebug bool) { |
| 29 | debug = logDebug |
| 30 | } |
| 31 | |
| 32 | /* |
| 33 | GetDebug returns debug setting |
| 34 | */ |
| 35 | func GetDebug() bool { |
| 36 | return debug |
| 37 | } |
donNewtonAlpha | af22974 | 2018-09-19 13:22:00 -0400 | [diff] [blame] | 38 | |
| 39 | /* |
| 40 | SetDummy sets dummy mode |
| 41 | */ |
| 42 | func SetDummy(dummyMode bool) { |
| 43 | dummy = dummyMode |
| 44 | } |
| 45 | |
| 46 | /* |
| 47 | GetDummy - returns the current value of dummy |
| 48 | */ |
| 49 | func GetDummy() bool { |
| 50 | return dummy |
| 51 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame^] | 52 | |
| 53 | /* |
| 54 | SetMongo - sets useMongo mode |
| 55 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 56 | func SetMongo(useMongo bool) { |
| 57 | mongo = useMongo |
| 58 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame^] | 59 | |
| 60 | /*GetMongo - returns the value of mongo |
| 61 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 62 | func GetMongo() bool { |
| 63 | return mongo |
| 64 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame^] | 65 | |
| 66 | /* |
| 67 | SetMongodb - sets the connection string for mongo db used for backups |
| 68 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 69 | func SetMongodb(connectString string) { |
| 70 | mongodb = connectString |
| 71 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame^] | 72 | |
| 73 | /* |
| 74 | GetMongodb - returns the connection string used for connecting to mongo db |
| 75 | */ |
donNewtonAlpha | c997d64 | 2018-10-17 13:22:48 -0400 | [diff] [blame] | 76 | func GetMongodb() string { |
| 77 | return mongodb |
| 78 | } |
Don Newton | 1652067 | 2018-11-28 14:44:42 -0500 | [diff] [blame^] | 79 | |
| 80 | /* |
| 81 | SetGrpc - sets useGrpc mode |
| 82 | */ |
| 83 | func SetGrpc(useGrpc bool) { |
| 84 | grpc = useGrpc |
| 85 | } |
| 86 | |
| 87 | /* |
| 88 | GetGrpc - returns the value of grpc |
| 89 | */ |
| 90 | func GetGrpc() bool { |
| 91 | return grpc |
| 92 | } |