github.com/ronaksoft/rony@v0.16.26-0.20230807065236-1743dbfe6959/cmd/rony/skel/conf/general.go (about) 1 package c 2 3 import "time" 4 5 const ( 6 ServerID = "server.id" 7 GatewayListen = "gateway.listen" 8 GatewayAdvertiseHostPort = "gateway.advertise.hostport" 9 TunnelListen = "tunnel.listen" 10 TunnelAdvertiseHostPort = "tunnel.advertise.hostport" 11 IdleTime = "idle-time" 12 ReplicaSet = "replica-set" 13 GossipPort = "gossip.port" 14 GossipSeedHostPort = "gossip.seed.hostport" 15 DataPath = "data.path" 16 Bootstrap = "bootstrap" 17 Host = "host" 18 Port = "port" 19 Config = "config" 20 ) 21 22 func GetConfig() string { 23 return globalC.GetString(Config) 24 } 25 26 func GetReplicaSet() uint64 { 27 return globalC.GetUint64(ReplicaSet) 28 } 29 30 func GetIdleTime() time.Duration { 31 return globalC.GetDuration(IdleTime) 32 } 33 34 func GetGatewayListen() string { 35 return globalC.GetString(GatewayListen) 36 } 37 38 func GetGatewayAdvertiseHostPort() []string { 39 return globalC.GetStringSlice(GatewayAdvertiseHostPort) 40 } 41 42 func GetTunnelListen() string { 43 return globalC.GetString(TunnelListen) 44 } 45 46 func GetTunnelAdvertiseHostPort() []string { 47 return globalC.GetStringSlice(TunnelAdvertiseHostPort) 48 } 49 50 func GetServerID() string { 51 return globalC.GetString(ServerID) 52 } 53 54 func GetGossipPort() int { 55 return globalC.GetInt(GossipPort) 56 } 57 58 func GetGossipSeedHostPort() string { 59 return globalC.GetString(GossipSeedHostPort) 60 } 61 62 func GetDataPath() string { 63 return globalC.GetString(DataPath) 64 } 65 66 func GetBootstrap() bool { 67 return globalC.GetBool(Bootstrap) 68 } 69 70 func GetHost() string { 71 return globalC.GetString(Host) 72 } 73 74 func GetPort() int { 75 return globalC.GetInt(Port) 76 }