Skip to content

Commit 09bf0db

Browse files
committed
Add oha and fq to arkade get
oha (hatoo/oha) is an HTTP load generator inspired by rakyll/hey with a TUI animation. fq (wader/fq) is a jq for binary formats, a tool and language plus decoders for working with binary data. Both ship static binaries for linux, darwin and windows on amd64 and arm64. Verified every combination with the file command. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
1 parent 69ff89e commit 09bf0db

3 files changed

Lines changed: 173 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ There are 53 apps that you can install on your cluster.
835835
| [firectl](https://github.com/firecracker-microvm/firectl) | Command-line tool that lets you run arbitrary Firecracker MicroVMs |
836836
| [flux](https://github.com/fluxcd/flux2) | Continuous Delivery solution for Kubernetes powered by GitOps Toolkit. |
837837
| [flyctl](https://github.com/superfly/flyctl) | Command line tools for fly.io services |
838+
| [fq](https://github.com/wader/fq) | jq for binary formats - a tool, language and decoders for working with binary data. |
838839
| [fstail](https://github.com/alexellis/fstail) | Tail modified files in a directory. |
839840
| [fzf](https://github.com/junegunn/fzf) | General-purpose command-line fuzzy finder |
840841
| [gh](https://github.com/cli/cli) | GitHub's official command line tool. |
@@ -923,6 +924,7 @@ There are 53 apps that you can install on your cluster.
923924
| [nu](https://github.com/nushell/nushell) | A new type of shell that can handle structured data like YAML really well |
924925
| [oc](https://github.com/openshift/oc) | Client to use an OpenShift 4.x cluster. |
925926
| [oh-my-posh](https://github.com/jandedobbeleer/oh-my-posh) | A prompt theme engine for any shell that can display kubernetes information. |
927+
| [oha](https://github.com/hatoo/oha) | HTTP load generator inspired by rakyll/hey with a tui animation. |
926928
| [op](https://github.com/1password/) | 1Password CLI enables you to automate administrative tasks and securely provision secrets across development environments. |
927929
| [opa](https://github.com/open-policy-agent/opa) | General-purpose policy engine that enables unified, context-aware policy enforcement across the entire stack. |
928930
| [opencode](https://github.com/anomalyco/opencode) | The opencode CLI for running AI agents and tools. |
@@ -983,5 +985,5 @@ There are 53 apps that you can install on your cluster.
983985
| [xq](https://github.com/sibprogrammer/xq) | XML to JSON/YAML converter and query tool. |
984986
| [yq](https://github.com/mikefarah/yq) | Portable command-line YAML processor. |
985987
| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | Fork of youtube-dl with additional features and fixes |
986-
There are 208 tools, use `arkade get NAME` to download one.
988+
There are 211 tools, use `arkade get NAME` to download one.
987989
<!-- end of tool list -->

pkg/get/get_test.go

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10832,3 +10832,117 @@ func Test_DownloadHunk(t *testing.T) {
1083210832
})
1083310833
}
1083410834
}
10835+
10836+
func Test_DownloadOha(t *testing.T) {
10837+
tools := MakeTools()
10838+
name := "oha"
10839+
10840+
tool := getTool(name, tools)
10841+
10842+
const toolVersion = "v1.15.0"
10843+
10844+
tests := []test{
10845+
{
10846+
os: "linux",
10847+
arch: arch64bit,
10848+
version: toolVersion,
10849+
url: "https://github.com/hatoo/oha/releases/download/v1.15.0/oha-linux-amd64",
10850+
},
10851+
{
10852+
os: "linux",
10853+
arch: archARM64,
10854+
version: toolVersion,
10855+
url: "https://github.com/hatoo/oha/releases/download/v1.15.0/oha-linux-arm64",
10856+
},
10857+
{
10858+
os: "darwin",
10859+
arch: arch64bit,
10860+
version: toolVersion,
10861+
url: "https://github.com/hatoo/oha/releases/download/v1.15.0/oha-macos-amd64",
10862+
},
10863+
{
10864+
os: "darwin",
10865+
arch: archDarwinARM64,
10866+
version: toolVersion,
10867+
url: "https://github.com/hatoo/oha/releases/download/v1.15.0/oha-macos-arm64",
10868+
},
10869+
{
10870+
os: "mingw64_nt-10.0-18362",
10871+
arch: arch64bit,
10872+
version: toolVersion,
10873+
url: "https://github.com/hatoo/oha/releases/download/v1.15.0/oha-windows-amd64.exe",
10874+
},
10875+
}
10876+
10877+
for _, tc := range tests {
10878+
t.Run(fmt.Sprintf("Download for: %s %s %s", tc.os, tc.arch, tc.version), func(r *testing.T) {
10879+
got, _, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
10880+
if err != nil {
10881+
t.Fatal(err)
10882+
}
10883+
if got != tc.url {
10884+
t.Errorf("\nwant: %s\ngot: %s", tc.url, got)
10885+
}
10886+
})
10887+
}
10888+
}
10889+
10890+
func Test_DownloadFq(t *testing.T) {
10891+
tools := MakeTools()
10892+
name := "fq"
10893+
10894+
tool := getTool(name, tools)
10895+
10896+
const toolVersion = "v0.17.0"
10897+
10898+
tests := []test{
10899+
{
10900+
os: "linux",
10901+
arch: arch64bit,
10902+
version: toolVersion,
10903+
url: "https://github.com/wader/fq/releases/download/v0.17.0/fq_0.17.0_linux_amd64.tar.gz",
10904+
},
10905+
{
10906+
os: "linux",
10907+
arch: archARM64,
10908+
version: toolVersion,
10909+
url: "https://github.com/wader/fq/releases/download/v0.17.0/fq_0.17.0_linux_arm64.tar.gz",
10910+
},
10911+
{
10912+
os: "darwin",
10913+
arch: arch64bit,
10914+
version: toolVersion,
10915+
url: "https://github.com/wader/fq/releases/download/v0.17.0/fq_0.17.0_macos_amd64.zip",
10916+
},
10917+
{
10918+
os: "darwin",
10919+
arch: archDarwinARM64,
10920+
version: toolVersion,
10921+
url: "https://github.com/wader/fq/releases/download/v0.17.0/fq_0.17.0_macos_arm64.zip",
10922+
},
10923+
{
10924+
os: "mingw64_nt-10.0-18362",
10925+
arch: arch64bit,
10926+
version: toolVersion,
10927+
url: "https://github.com/wader/fq/releases/download/v0.17.0/fq_0.17.0_windows_amd64.zip",
10928+
},
10929+
{
10930+
os: "mingw64_nt-10.0-18362",
10931+
arch: archARM64,
10932+
version: toolVersion,
10933+
url: "https://github.com/wader/fq/releases/download/v0.17.0/fq_0.17.0_windows_arm64.zip",
10934+
},
10935+
}
10936+
10937+
for _, tc := range tests {
10938+
t.Run(fmt.Sprintf("Download for: %s %s %s", tc.os, tc.arch, tc.version), func(r *testing.T) {
10939+
got, _, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
10940+
if err != nil {
10941+
t.Fatal(err)
10942+
}
10943+
if got != tc.url {
10944+
t.Errorf("\nwant: %s\ngot: %s", tc.url, got)
10945+
}
10946+
})
10947+
}
10948+
}

pkg/get/tools.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5922,5 +5922,61 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{$fileNa
59225922
https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{$fileName}}`,
59235923
})
59245924

5925+
tools = append(tools,
5926+
Tool{
5927+
Owner: "hatoo",
5928+
Repo: "oha",
5929+
Name: "oha",
5930+
Description: "HTTP load generator inspired by rakyll/hey with a tui animation.",
5931+
BinaryTemplate: `
5932+
{{$os := .OS}}
5933+
{{$arch := .Arch}}
5934+
{{$ext := ""}}
5935+
{{- if eq .OS "darwin" -}}
5936+
{{$os = "macos"}}
5937+
{{- else if HasPrefix .OS "ming" -}}
5938+
{{$os = "windows"}}
5939+
{{$ext = ".exe"}}
5940+
{{- end -}}
5941+
5942+
{{- if eq .Arch "aarch64" -}}
5943+
{{$arch = "arm64"}}
5944+
{{- else if eq .Arch "x86_64" -}}
5945+
{{$arch = "amd64"}}
5946+
{{- end -}}
5947+
5948+
{{.Name}}-{{$os}}-{{$arch}}{{$ext}}
5949+
`,
5950+
})
5951+
5952+
tools = append(tools,
5953+
Tool{
5954+
Owner: "wader",
5955+
Repo: "fq",
5956+
Name: "fq",
5957+
Description: "jq for binary formats - a tool, language and decoders for working with binary data.",
5958+
URLTemplate: `
5959+
{{$os := .OS}}
5960+
{{$arch := .Arch}}
5961+
{{$ext := "tar.gz"}}
5962+
{{- if eq .OS "darwin" -}}
5963+
{{$os = "macos"}}
5964+
{{$ext = "zip"}}
5965+
{{- else if HasPrefix .OS "ming" -}}
5966+
{{$os = "windows"}}
5967+
{{$ext = "zip"}}
5968+
{{- end -}}
5969+
5970+
{{- if eq .Arch "aarch64" -}}
5971+
{{$arch = "arm64"}}
5972+
{{- else if eq .Arch "x86_64" -}}
5973+
{{$arch = "amd64"}}
5974+
{{- end -}}
5975+
5976+
https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/fq_{{.VersionNumber}}_{{$os}}_{{$arch}}.{{$ext}}
5977+
`,
5978+
BinaryTemplate: `fq`,
5979+
})
5980+
59255981
return tools
59265982
}

0 commit comments

Comments
 (0)