38 lines
857 B
Go
38 lines
857 B
Go
package users
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/hashicorp/boundary/api/users"
|
|
"github.com/hashicorp/boundary/internal/cmd/base"
|
|
)
|
|
|
|
func generateUserTableOutput(in *users.User) string {
|
|
var ret []string
|
|
// This if true is here to line up columns for easy editing
|
|
if true {
|
|
ret = append(ret, []string{
|
|
"",
|
|
"User information:",
|
|
fmt.Sprintf(" ID: %s", in.Id),
|
|
fmt.Sprintf(" Version: %d", in.Version),
|
|
fmt.Sprintf(" Created Time: %s", in.CreatedTime.Local().Format(time.RFC3339)),
|
|
fmt.Sprintf(" Updated Time: %s", in.UpdatedTime.Local().Format(time.RFC3339)),
|
|
}...,
|
|
)
|
|
}
|
|
if in.Name != "" {
|
|
ret = append(ret,
|
|
fmt.Sprintf(" Name: %s", in.Name),
|
|
)
|
|
}
|
|
if in.Description != "" {
|
|
ret = append(ret,
|
|
fmt.Sprintf(" Description: %s", in.Description),
|
|
)
|
|
}
|
|
|
|
return base.WrapForHelpText(ret)
|
|
}
|