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

Function toServiceTokenRow

cli/pkg/printer/resources.go:371–383  ·  view source on GitHub ↗
(s *adminv1.ServiceToken)

Source from the content-addressed store, hash-verified

369}
370
371func toServiceTokenRow(s *adminv1.ServiceToken) *serviceToken {
372 var expiresOn string
373 if !s.ExpiresOn.AsTime().IsZero() {
374 expiresOn = s.ExpiresOn.AsTime().Local().Format(time.DateTime)
375 }
376
377 return &serviceToken{
378 ID: s.Id,
379 Prefix: s.Prefix,
380 CreatedOn: s.CreatedOn.AsTime().Local().Format(time.DateTime),
381 ExpiresOn: expiresOn,
382 }
383}
384
385type serviceToken struct {
386 ID string `header:"id" json:"id"`

Callers 1

PrintServiceTokensMethod · 0.85

Calls 2

FormatMethod · 0.65
IsZeroMethod · 0.45

Tested by

no test coverage detected