-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add version command; fix get_server etc.
- Loading branch information
Pavel Anni
committed
Jan 31, 2025
1 parent
9f1721a
commit 983fcbd
Showing
12 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
|
||
"github.com/pavelanni/storctl/internal/version" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewVersionCmd() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "version", | ||
Short: "Print version information", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Printf("Version: %s\n", version.Version) | ||
fmt.Printf("Commit: %s\n", version.Commit) | ||
fmt.Printf("Build Date: %s\n", version.Date) | ||
fmt.Printf("Go Version: %s\n", version.GoVersion) | ||
fmt.Printf("OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH) | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Using limactl | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Date | ||
|
||
2024-01-29 | ||
|
||
## Context | ||
|
||
- Need to work with virtual machines on a macOS or Linux host | ||
- Lima is a tool of choice on macOS and also available on Linux | ||
- Lima can use QEMU as a backend virtualization engine | ||
- Lima is written in Go | ||
- There is an option to use Lima's Go library or use the CLI tool `limactl` from inside our Go code | ||
- There is also Colima that is a wrapper for Lima but it uses Docker instead of `containerd` as a containerization engine | ||
|
||
## Decision | ||
|
||
Use `limactl` CLI calls from inside Go code. | ||
|
||
1. The Go library used by Lima developers is not created for external consumption. | ||
To use it we would have to go deep into its ecosystem and import a lot of other dependencies. | ||
|
||
2. The CLI interface is more stable so we are more safe in this case. | ||
|
||
3. In our case, performance is not a significant factor, so there is not much gain in using the native Go library. | ||
|
||
## Consequences | ||
|
||
### Positive | ||
|
||
- More stable interface | ||
- Fewer imports/dependencies | ||
|
||
### Negative | ||
|
||
- Need to parse the command JSON output | ||
- Slightly lower performance (but not visible by the end user) | ||
|
||
## Related Decisions | ||
|
||
|
||
## Notes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package version | ||
|
||
var ( | ||
Version = "dev" | ||
Commit = "none" | ||
Date = "unknown" | ||
GoVersion = "unknown" | ||
) |