From 07662d9403eb85b39e1ffcf91014bbf36efd1c5a Mon Sep 17 00:00:00 2001 From: s Date: Thu, 13 Nov 2025 22:25:02 -0500 Subject: refactor: break down large osint.go file into separate command modules and add helper functions --- cmd/helpers.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cmd/helpers.go (limited to 'cmd/helpers.go') 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) +} -- cgit v1.2.3