etcd_path.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package comp
  2. import (
  3. "fmt"
  4. pb "git.wanbits.io/joe/franklin/protos"
  5. )
  6. /// see docs/ConfManagement.md
  7. var (
  8. PathServers = func(c *pb.AppConf) string {
  9. return fmt.Sprintf("%s/conf/servers", c.Namespace)
  10. }
  11. PathApps = func(c *pb.AppConf) string {
  12. return fmt.Sprintf("%s/apps", c.Namespace)
  13. }
  14. PathRedis = func(c *pb.AppConf) string {
  15. return fmt.Sprintf("%s/redis", PathServers(c))
  16. }
  17. PathMq = func(c *pb.AppConf) string {
  18. return fmt.Sprintf("%s/mq", PathServers(c))
  19. }
  20. PathEvBus = func(c *pb.AppConf) string {
  21. return fmt.Sprintf("%s/evbus", PathServers(c))
  22. }
  23. PathLogin = func(c *pb.AppConf) string {
  24. return fmt.Sprintf("%s/conf/servers/login", c.Namespace)
  25. }
  26. PathKv = func(c *pb.AppConf) string {
  27. return fmt.Sprintf("%s/kv", PathServers(c))
  28. }
  29. PathLobbies = func(c *pb.AppConf) string {
  30. return fmt.Sprintf("%s/lobbies", PathApps(c))
  31. }
  32. PathAgents = func(c *pb.AppConf) string {
  33. return fmt.Sprintf("%s/agents", PathApps(c))
  34. }
  35. PathLogics = func(c *pb.AppConf) string {
  36. return fmt.Sprintf("%s/logics", PathApps(c))
  37. }
  38. PathManagers = func(c *pb.AppConf) string {
  39. return fmt.Sprintf("%s/managers", PathApps(c))
  40. }
  41. )