cisco/sdk/config.go -rw-r--r-- 385 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package cisco

type Config struct {
	Endpoint string
	Key      string
	Secret   string
	Debug    bool
}

var GlobalConfig Config

func SetConfig(conf *Config) {
	if conf.Endpoint != "" {
		GlobalConfig.Endpoint = conf.Endpoint
	}

	if conf.Key != "" {
		GlobalConfig.Key = conf.Key
	}

	if conf.Secret != "" {
		GlobalConfig.Secret = conf.Secret
	}

	GlobalConfig.Debug = conf.Debug
}