mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
27 lines
588 B
Go
27 lines
588 B
Go
package views
|
|
|
|
import (
|
|
"io"
|
|
|
|
fctl "github.com/formancehq/fctl/pkg"
|
|
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
|
|
"github.com/pterm/pterm"
|
|
)
|
|
|
|
func PrintSecrets(out io.Writer, secrets []shared.ClientSecret) error {
|
|
fctl.Section.WithWriter(out).Println("Secrets :")
|
|
|
|
return pterm.DefaultTable.
|
|
WithWriter(out).
|
|
WithHasHeader(true).
|
|
WithData(fctl.Prepend(
|
|
fctl.Map(secrets, func(secret shared.ClientSecret) []string {
|
|
return []string{
|
|
secret.ID, secret.Name, secret.LastDigits,
|
|
}
|
|
}),
|
|
[]string{"ID", "Name", "Last digits"},
|
|
)).
|
|
Render()
|
|
}
|