diff options
| author | s <[email protected]> | 2025-11-13 22:25:02 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-13 22:25:02 -0500 |
| commit | 07662d9403eb85b39e1ffcf91014bbf36efd1c5a (patch) | |
| tree | 1181435223899bae039a947c5fc4fdeec085f91b /cmd/helpers.go | |
| parent | 239936e87183a10a33ce593709eb16c92a04af98 (diff) | |
| download | dborg-07662d9403eb85b39e1ffcf91014bbf36efd1c5a.tar.gz dborg-07662d9403eb85b39e1ffcf91014bbf36efd1c5a.zip | |
refactor: break down large osint.go file into separate command modules and add helper functionsv1.0.1
Diffstat (limited to 'cmd/helpers.go')
| -rw-r--r-- | cmd/helpers.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cmd/helpers.go b/cmd/helpers.go new file mode 100644 index 0000000..f53f235 --- /dev/null +++ b/cmd/helpers.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "fmt" + + "git.db.org.ai/dborg/internal/client" + "git.db.org.ai/dborg/internal/config" +) + +func newClient() (*client.Client, error) { + return client.New(config.New()) +} + +func newUnauthenticatedClient() (*client.Client, error) { + return client.NewUnauthenticated(config.New()) +} + +func checkError(errorMsg string) error { + if errorMsg != "" { + return fmt.Errorf("API error: %s", errorMsg) + } + return nil +} + +func printOutput(output string) { + fmt.Print(output) +} |
