Documentation ¶
Index ¶
- func FormatApiKey(key *models.APIKey, opt string) string
- func FormatApiKeys(keys []*models.APIKey, opt string) string
- func FormatCommand(command *models.Command, opt string) string
- func FormatCommandRun(run *models.CommandRun, opt string) string
- func FormatCommands(commands []*models.Command, opt string) string
- func FormatCreatedApiKey(key *models.APIKey, opt string) string
- func FormatEvent(event *models.Event, opt string) string
- func FormatEvents(events []*models.Event, opt string) string
- func FormatPlatforms(platforms []models.Platform, opt string) string
- func FormatRepositories(repos []*models.Repository, opt string) string
- func FormatRepository(repo *models.Repository, opt string) string
- func FormatSetting(setting *models.CommandSetting, opt string) string
- func FormatSettings(settings []*models.CommandSetting, opt string) string
- func FormatUser(user *models.User, opt string) string
- func FormatUsers(users []*models.User, opt string) string
- func FormatVaultSecret(secret *models.VaultSetting, opt string) string
- func FormatVaultSecrets(secrets []string, opt string) string
- type Formatter
- type JSONFormatter
- type TableFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatApiKey ¶
FormatApiKey formats an api key and displays it with the request format option.
func FormatApiKeys ¶
FormatApiKeys formats a list of api keys and displays it with the requested format option.
func FormatCommand ¶
FormatCommand formats a command and displays it with the request format option.
func FormatCommandRun ¶
func FormatCommandRun(run *models.CommandRun, opt string) string
FormatCommandRun formats a command run and displays it with the request format option.
func FormatCommands ¶
FormatCommands formats a list of commands and displays it with the requested format option.
func FormatCreatedApiKey ¶
FormatCreatedApiKey formats an api key and displays it with the request format option including the generated random secret.
func FormatEvent ¶
FormatEvent formats a event and displays it with the request format option.
func FormatEvents ¶
FormatEvents formats a list of events and displays it with the requested format option.
func FormatPlatforms ¶
FormatPlatforms formats a list of platforms and displays it with the requested format option.
func FormatRepositories ¶
func FormatRepositories(repos []*models.Repository, opt string) string
FormatRepositories formats a list of repositories and displays it with the requested format option.
func FormatRepository ¶
func FormatRepository(repo *models.Repository, opt string) string
FormatRepository formats a repository and displays it with the request format option.
func FormatSetting ¶
func FormatSetting(setting *models.CommandSetting, opt string) string
FormatSetting formats a setting and displays it with the request format option.
func FormatSettings ¶
func FormatSettings(settings []*models.CommandSetting, opt string) string
FormatSettings formats a list of settings and displays it with the request format option.
func FormatUser ¶
FormatUser formats a user and displays it with the request format option.
func FormatUsers ¶
FormatUsers formats a list of users and displays it with the requested format option.
func FormatVaultSecret ¶
func FormatVaultSecret(secret *models.VaultSetting, opt string) string
FormatVaultSecret formats a single object of vault secret and displays it with the requested format option.
func FormatVaultSecrets ¶
FormatVaultSecrets formats a list of vault secrets and displays it with the requested format option.
Types ¶
type Formatter ¶
Formatter defines a formatter for the returned data. JSON or Table are supported for now.
func NewFormatter ¶
NewFormatter creates a formatter based on a set argument.
type JSONFormatter ¶
type JSONFormatter struct{}
JSONFormatter takes a raw data and formats it as JSON data
func (*JSONFormatter) FormatList ¶
func (j *JSONFormatter) FormatList(data [][]kv) string
FormatList formats a list of key value objects as JSON.
func (*JSONFormatter) FormatObject ¶
func (j *JSONFormatter) FormatObject(data []kv) string
FormatObject formats a key value list as JSON.
type TableFormatter ¶
type TableFormatter struct{}
TableFormatter formats data as table entries.
func (*TableFormatter) FormatList ¶
func (t *TableFormatter) FormatList(data [][]kv) string
FormatList formats a list of key value objects as Table.
func (*TableFormatter) FormatObject ¶
func (t *TableFormatter) FormatObject(data []kv) string
FormatObject formats a key value list as Table.