Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. {
  2. "message": {
  3. "Server1.example.com": [
  4. {
  5. "application": "Apache",
  6. "host": {
  7. "name": "/^Server-[13456]/"
  8. },
  9. "owner": "User1",
  10. "project": "Web",
  11. "subowner": "User2"
  12. }
  13. ],
  14. "Server2.example.com": [
  15. {
  16. "application": "Mysql",
  17. "host": {
  18. "name": "/^Server[23456]/"
  19. },
  20. "owner": "User2",
  21. "project": "DB",
  22. "subowner": "User3"
  23. }
  24. ]
  25. },
  26. "response_ms": 659,
  27. "success": true
  28. }
  29.  
  30. type ServerDetails struct {
  31. Message struct{
  32. Hostname struct{
  33. Details struct{
  34. Application string `json:"application"`
  35. }`json:"-"`
  36. }`json:"-"`
  37. }`json:"message"`
  38. }
  39.  
  40. {
  41. "application": "Apache",
  42. "host": {
  43. "name": "/^Server-[13456]/"
  44. },
  45.  
  46. type YourStruct struct {
  47. Success bool
  48. ResponseMS int
  49. Servers map[string]*ServerStruct
  50. }
  51.  
  52. type ServerStruct struct {
  53. Application string
  54. Owner string
  55. [...]
  56. }
  57.  
  58. type AutoGenerated struct {
  59. Message struct {
  60. Server1ExampleCom []struct {
  61. Application string `json:"application"`
  62. Host struct {
  63. Name string `json:"name"`
  64. } `json:"host"`
  65. Owner string `json:"owner"`
  66. Project string `json:"project"`
  67. Subowner string `json:"subowner"`
  68. } `json:"Server1.example.com"`
  69. Server2ExampleCom []struct {
  70. Application string `json:"application"`
  71. Host struct {
  72. Name string `json:"name"`
  73. } `json:"host"`
  74. Owner string `json:"owner"`
  75. Project string `json:"project"`
  76. Subowner string `json:"subowner"`
  77. } `json:"Server2.example.com"`
  78. } `json:"message"`
  79. ResponseMs int `json:"response_ms"`
  80. Success bool `json:"success"`
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement