Documentation
¶
Index ¶
- func ExecuteShellCommand(command string) error
- func FollowRedirects(url string) (string, error)
- func FormatDuration(milliseconds int64) string
- func ParseHTTPError(err error, htt *http.Response) error
- func PrettyJSON(j []byte) string
- func ServiceFqnToStr(s ServiceFqn) string
- func SortByVersion(unsorted []string) []string
- func TransformValidationError(inputJSON string) ([]string, error)
- type GeneralKeyMap
- type ServiceFqn
- type ServiceInformation
- type UpdateAvailable
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteShellCommand ¶ added in v1.7.0
ExecuteShellCommand replaces the current process with a shell that runs the given command. This supports pipes, redirection, and all shell features.
func FollowRedirects ¶ added in v1.3.0
func FormatDuration ¶
func PrettyJSON ¶
Prints JSON bytes nicely indented, or returns the original bytes as string if it fails
func ServiceFqnToStr ¶ added in v1.3.0
func ServiceFqnToStr(s ServiceFqn) string
func SortByVersion ¶
SortByVersion sorts a slice of strings by semantic version number, highest first
func TransformValidationError ¶ added in v1.3.0
Types ¶
type GeneralKeyMap ¶ added in v1.3.0
type GeneralKeyMap struct {
help.KeyMap
// For non-interactive mode
Quit key.Binding
// General navigation
Back key.Binding
Retry key.Binding
Cancel key.Binding
// Directions
Up key.Binding
Down key.Binding
Left key.Binding
Right key.Binding
Next key.Binding
Previous key.Binding
// Operations on items
Delete key.Binding
New key.Binding
Confirm key.Binding
Save key.Binding
// Misc
Toggle key.Binding
Logs key.Binding
Details key.Binding
Configure key.Binding
}
This is a reusable key map that can be used for many different views (you can select which key.Binding to implement)
func NewGeneralKeyMap ¶ added in v1.3.0
func NewGeneralKeyMap() GeneralKeyMap
For at least implementing the quit key
func (GeneralKeyMap) FullHelp ¶ added in v1.3.0
func (k GeneralKeyMap) FullHelp() [][]key.Binding
FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.
func (GeneralKeyMap) ShortHelp ¶ added in v1.3.0
func (k GeneralKeyMap) ShortHelp() []key.Binding
ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.
type ServiceFqn ¶
type ServiceInformation ¶ added in v1.6.0
Parsed from the service YAML files (simplified)
func GetServiceInformation ¶ added in v1.6.0
func GetServiceInformation(path string) (*ServiceInformation, error)
type UpdateAvailable ¶ added in v1.7.0
type UpdateAvailable struct {
Name string
Available bool
CurrentVersion string
LatestVersion string
}
func CheckForGithubUpdate ¶ added in v1.7.0
func CheckForGithubUpdate(name string, org string, currentVersion string) (*UpdateAvailable, error)
CheckForGithubUpdate checks if an update is available for the given repository by checking releases on GitHub
type ValidationError ¶ added in v1.3.0
type ValidationError struct {
ValidationErrors struct {
UnmetStreams []struct {
Source string `json:"source"`
Target string `json:"target"`
Stream string `json:"stream"`
} `json:"unmet_streams"`
} `json:"validation_errors"`
}
Define the structure of the JSON input