30 lines
631 B
Go
30 lines
631 B
Go
|
|
package conf
|
||
|
|
|
||
|
|
import (
|
||
|
|
"os"
|
||
|
|
"strings"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Config struct {
|
||
|
|
Hostname string
|
||
|
|
Account string
|
||
|
|
AccountID string
|
||
|
|
}
|
||
|
|
|
||
|
|
func Get() *Config {
|
||
|
|
host, _ := os.Hostname()
|
||
|
|
host = strings.ToLower(host)
|
||
|
|
|
||
|
|
switch host {
|
||
|
|
case "desktop-t5lh34v":
|
||
|
|
return &Config{Hostname: host, Account: "david", AccountID: "86037237"}
|
||
|
|
case "t8zznqs49f1ju7q":
|
||
|
|
return &Config{Hostname: host, Account: "liao", AccountID: "8889399698"}
|
||
|
|
case "dhzd0ojkpctafmm":
|
||
|
|
return &Config{Hostname: host, Account: "zhang", AccountID: "8889616198"}
|
||
|
|
case "f7tib45aqk4n10h":
|
||
|
|
return &Config{Hostname: host, Account: "long", AccountID: "8886508526"}
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|