Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &command.Command{ Cobra: &cobra.Command{ Args: cobra.NoArgs, Use: "list", Short: "list Triton Access Keys", Aliases: []string{"ls"}, SilenceUsage: true, PreRunE: func(cmd *cobra.Command, args []string) error { return nil }, RunE: func(cmd *cobra.Command, args []string) error { cons := conswriter.GetTerminal() c, err := cfg.NewTritonConfig() if err != nil { return err } a, err := account.NewAccountClient(c) if err != nil { return err } accesskeys, err := a.ListAccessKeys() if err != nil { return err } table := tablewriter.NewWriter(cons) table.SetHeaderAlignment(tablewriter.ALIGN_CENTER) table.SetHeaderLine(false) table.SetAutoFormatHeaders(true) table.SetColumnAlignment([]int{tablewriter.ALIGN_LEFT, tablewriter.ALIGN_LEFT}) table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) table.SetCenterSeparator("") table.SetColumnSeparator("") table.SetRowSeparator("") table.SetHeader([]string{"ID", "SECRET"}) for _, accesskey := range accesskeys { table.Append([]string{accesskey.AccessKeyID, accesskey.SecretAccessKey}) } table.Render() return nil }, }, Setup: func(parent *command.Command) error { return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.