(s *schema.Schema, buffer *bytes.Buffer, resource map[string]interface{})
| 106 | } |
| 107 | |
| 108 | func (gohanClientCLI *GohanClientCLI) createSingleResourceTable(s *schema.Schema, buffer *bytes.Buffer, resource map[string]interface{}) { |
| 109 | include := gohanClientCLI.fieldFilter(s) |
| 110 | table := tablewriter.NewWriter(buffer) |
| 111 | table.SetHeader([]string{"Property", "Value"}) |
| 112 | for _, property := range s.Properties { |
| 113 | if include != nil && !include[normField(property.ID, s.ID)] { |
| 114 | continue |
| 115 | } |
| 116 | |
| 117 | table.Append([]string{property.Title, fmt.Sprint(resource[property.ID])}) |
| 118 | } |
| 119 | table.Render() |
| 120 | } |
| 121 | |
| 122 | //fieldFilter returns opts filters as string to boolean map with normalised keys. |
| 123 | func (gohanClientCLI *GohanClientCLI) fieldFilter(s *schema.Schema) map[string]bool { |
no test coverage detected