MCPcopy Create free account
hub / github.com/rilldata/rill / toBillingIssueRow

Function toBillingIssueRow

cli/pkg/printer/resources.go:696–708  ·  view source on GitHub ↗
(e *adminv1.BillingIssue)

Source from the content-addressed store, hash-verified

694}
695
696func 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
710type billingIssue struct {
711 Organization string `header:"organization" json:"organization"`

Callers 1

toBillingIssuesTableFunction · 0.85

Calls 3

StringMethod · 0.65
FormatMethod · 0.65
ValidMethod · 0.45

Tested by

no test coverage detected