(e *adminv1.BillingIssue)
| 694 | } |
| 695 | |
| 696 | func toBillingIssueRow(e *adminv1.BillingIssue) *billingIssue { |
| 697 | meta, err := json.Marshal(e.Metadata) |
| 698 | if err != nil || !utf8.Valid(meta) { |
| 699 | meta = []byte("{\"error\": \"failed to marshal metadata\"}") |
| 700 | } |
| 701 | return &billingIssue{ |
| 702 | Organization: e.Org, |
| 703 | Type: e.Type.String(), |
| 704 | Level: e.Level.String(), |
| 705 | Metadata: string(meta), // TODO pretty print |
| 706 | EventTime: e.EventTime.AsTime().Local().Format(time.DateTime), |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | type billingIssue struct { |
| 711 | Organization string `header:"organization" json:"organization"` |
no test coverage detected