From c36b3fabfbad25a6288227a5c4397349464cf465 Mon Sep 17 00:00:00 2001 From: Travis Bale Date: Sun, 31 Dec 2023 13:23:06 -0500 Subject: [PATCH] rebase with cobra changes --- cmd/root.go | 10 +++++----- go.mod | 6 ++++-- main.go | 6 +++--- models/config/source_file_test.go | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index cf1c42b..b03a3fa 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,9 +4,9 @@ import ( "fmt" "os" - config "github.com/kyallanum/athena/v1.0.0/models/config" - library "github.com/kyallanum/athena/v1.0.0/models/library" - logs "github.com/kyallanum/athena/v1.0.0/models/logs" + config "github.com/kyallanum/athena/models/config" + library "github.com/kyallanum/athena/models/library" + logs "github.com/kyallanum/athena/models/logs" "github.com/spf13/cobra" ) @@ -36,7 +36,7 @@ func Execute() error { } err := rootCmd.Execute() - errCheck(err) + errCheck(err) fmt.Println("Athena v1.0.0 Starting") fmt.Println("Getting Configuration File: ", configFile, "...") @@ -78,7 +78,7 @@ func resolveLogFile(contents *logs.LogFile, configuration *config.Configuration) return nil, fmt.Errorf("configuration does not have any rules") } - ret_library := library.Library.New(library.Library{}, configuration.Name) + ret_library := library.New(configuration.Name) fmt.Println("Resolving Log File") for i := 0; i < len(configuration.Rules); i++ { diff --git a/go.mod b/go.mod index 9f14624..ae60ff9 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,13 @@ module github.com/kyallanum/athena go 1.21 -require github.com/davidmytton/url-verifier v1.0.0 +require ( + github.com/davidmytton/url-verifier v1.0.0 + github.com/spf13/cobra v1.8.0 +) require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect ) diff --git a/main.go b/main.go index b93a5c9..5473353 100644 --- a/main.go +++ b/main.go @@ -6,9 +6,9 @@ import ( "os" "github.com/kyallanum/athena/cmd" - "github.com/kyallanum/athena/models/config" - "github.com/kyallanum/athena/models/library" - "github.com/kyallanum/athena/models/logs" + config "github.com/kyallanum/athena/models/config" + library "github.com/kyallanum/athena/models/library" + logs "github.com/kyallanum/athena/models/logs" ) func errCheck(err error) { diff --git a/models/config/source_file_test.go b/models/config/source_file_test.go index 93b4c8e..c0a861c 100644 --- a/models/config/source_file_test.go +++ b/models/config/source_file_test.go @@ -15,7 +15,7 @@ func TestNewFileConfig(t *testing.T) { t.Errorf("Configuration source type not set properly") } - if reflect.TypeOf(fileSource).String() != "*models.ConfigFileSource" { + if reflect.TypeOf(fileSource).String() != "*models.FileSource" { t.Errorf("Configuration source not of the right type") } }