https://github.com/rfc2119/aws-tui
[WIP] Unofficial terminal Interface for AWS
https://github.com/rfc2119/aws-tui
aws golang tui
Last synced: 5 months ago
JSON representation
[WIP] Unofficial terminal Interface for AWS
- Host: GitHub
- URL: https://github.com/rfc2119/aws-tui
- Owner: rfc2119
- Created: 2020-08-31T07:18:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-18T13:54:00.000Z (over 4 years ago)
- Last Synced: 2025-08-03T00:08:39.562Z (11 months ago)
- Topics: aws, golang, tui
- Language: Go
- Homepage:
- Size: 194 KB
- Stars: 26
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: readme.go
Awesome Lists containing this project
README
package main
// Inspired from [awsls](https://github.com/jckuester/awsls) readme file
// TODO: should be executed when building for releases
import (
"os"
"github.com/rfc2119/aws-tui/common"
"text/template"
)
var readmeTable = `
# Current Working Services
| Service Name | Implemented | Description |
| :----------: | :---------: | :---------: |
{{ range $serviceName, $desc := . }}|{{$desc.Name}} | {{if $desc.Available}} ✓ {{end}} | {{$desc.Description}}|
{{ end }}
`
func AppendReadMeTable(readmeFileName string) error {
f, err := os.OpenFile(readmeFileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
return err
}
defer f.Close()
templ := template.Must(template.New("readmeTable").Parse(readmeTable))
if err := templ.Execute(f, common.AWServicesDescriptions); err != nil {
return err
}
return nil
}
// {{range pipeline}} T1 {{end}}
// The value of the pipeline must be an array, slice, map, or channel.
// If the value of the pipeline has length zero, nothing is output;
// otherwise, dot is set to the successive elements of the array,
// slice, or map and T1 is executed. If the value is a map and the
// keys are of basic type with a defined order, the elements will be
// visited in sorted key order.
// {{with pipeline}} T1 {{end}}
// If the value of the pipeline is empty, no output is generated;
// otherwise, dot is set to the value of the pipeline and T1 is
// executed.
// range $index, $element := pipeline
// Note that if there is only one variable, it is assigned the element; this is opposite to the convention in Go range clauses