diff --git a/database/build/build.go b/database/build/build.go index 6deb13892..887302335 100644 --- a/database/build/build.go +++ b/database/build/build.go @@ -38,9 +38,7 @@ type ( ) // New creates and returns a Vela service for integrating with builds in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (BuildInterface, error) { // create new Build engine e := new(engine) diff --git a/database/build/build_test.go b/database/build/build_test.go index 070744260..cbf6e896a 100644 --- a/database/build/build_test.go +++ b/database/build/build_test.go @@ -139,7 +139,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -148,7 +148,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres build engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -161,7 +161,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -170,7 +170,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite build engine: %v", err) } - return _engine + return _interface.(*engine) } // testBuild is a test helper function to create a library diff --git a/database/doc.go b/database/doc.go index 42fe1feae..f9468e498 100644 --- a/database/doc.go +++ b/database/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/count.go b/database/hook/count.go index a1a9689f8..306ecf5af 100644 --- a/database/hook/count.go +++ b/database/hook/count.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/count_repo.go b/database/hook/count_repo.go index eb6d6763b..ddc18b246 100644 --- a/database/hook/count_repo.go +++ b/database/hook/count_repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/count_repo_test.go b/database/hook/count_repo_test.go index 5814764e6..42b55c04a 100644 --- a/database/hook/count_repo_test.go +++ b/database/hook/count_repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/count_test.go b/database/hook/count_test.go index dce97587f..9250fff6e 100644 --- a/database/hook/count_test.go +++ b/database/hook/count_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/create.go b/database/hook/create.go index e2bf5489d..9b5c1bc65 100644 --- a/database/hook/create.go +++ b/database/hook/create.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/create_test.go b/database/hook/create_test.go index f05bd8a9d..b288f1064 100644 --- a/database/hook/create_test.go +++ b/database/hook/create_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/delete.go b/database/hook/delete.go index d4e688f1c..fed1f3964 100644 --- a/database/hook/delete.go +++ b/database/hook/delete.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/delete_test.go b/database/hook/delete_test.go index 2fb91d567..7f17b9944 100644 --- a/database/hook/delete_test.go +++ b/database/hook/delete_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/get.go b/database/hook/get.go index 13547669c..e492c897e 100644 --- a/database/hook/get.go +++ b/database/hook/get.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/get_repo.go b/database/hook/get_repo.go index 4c7e3b857..b8bb054a0 100644 --- a/database/hook/get_repo.go +++ b/database/hook/get_repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/get_repo_test.go b/database/hook/get_repo_test.go index 32fb9a813..9b5290c47 100644 --- a/database/hook/get_repo_test.go +++ b/database/hook/get_repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/get_test.go b/database/hook/get_test.go index b84fe7b13..e128c9480 100644 --- a/database/hook/get_test.go +++ b/database/hook/get_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/hook.go b/database/hook/hook.go index 5225f901a..5487d74ed 100644 --- a/database/hook/hook.go +++ b/database/hook/hook.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -38,9 +38,7 @@ type ( ) // New creates and returns a Vela service for integrating with hooks in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (HookInterface, error) { // create new Hook engine e := new(engine) diff --git a/database/hook/hook_test.go b/database/hook/hook_test.go index e8d3130cc..95701b35b 100644 --- a/database/hook/hook_test.go +++ b/database/hook/hook_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -132,7 +132,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -141,7 +141,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres hook engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -154,7 +154,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -163,7 +163,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite hook engine: %v", err) } - return _engine + return _interface.(*engine) } // testHook is a test helper function to create a library diff --git a/database/hook/index.go b/database/hook/index.go index a2061eaf9..8b931c45c 100644 --- a/database/hook/index.go +++ b/database/hook/index.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/index_test.go b/database/hook/index_test.go index 06ab40a95..5e9c52f0a 100644 --- a/database/hook/index_test.go +++ b/database/hook/index_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/interface.go b/database/hook/interface.go index 4ed44fd84..fb414bae5 100644 --- a/database/hook/interface.go +++ b/database/hook/interface.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/last_repo.go b/database/hook/last_repo.go index 22c3ef992..a894c1b32 100644 --- a/database/hook/last_repo.go +++ b/database/hook/last_repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/last_repo_test.go b/database/hook/last_repo_test.go index ecd4a3eea..fee246e9e 100644 --- a/database/hook/last_repo_test.go +++ b/database/hook/last_repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/list.go b/database/hook/list.go index 1152738e6..5f212ed11 100644 --- a/database/hook/list.go +++ b/database/hook/list.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/list_repo.go b/database/hook/list_repo.go index 1060f5863..9b096f34c 100644 --- a/database/hook/list_repo.go +++ b/database/hook/list_repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/list_repo_test.go b/database/hook/list_repo_test.go index c229f5674..44f91ced8 100644 --- a/database/hook/list_repo_test.go +++ b/database/hook/list_repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/list_test.go b/database/hook/list_test.go index e2fb33772..50e3c07cf 100644 --- a/database/hook/list_test.go +++ b/database/hook/list_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/opts.go b/database/hook/opts.go index e88e92da7..c63da778a 100644 --- a/database/hook/opts.go +++ b/database/hook/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/opts_test.go b/database/hook/opts_test.go index 81946c8f4..b01392cf6 100644 --- a/database/hook/opts_test.go +++ b/database/hook/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/table.go b/database/hook/table.go index 90419508f..40d1eabcc 100644 --- a/database/hook/table.go +++ b/database/hook/table.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/table_test.go b/database/hook/table_test.go index 915621718..b67d29558 100644 --- a/database/hook/table_test.go +++ b/database/hook/table_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/update.go b/database/hook/update.go index d7741f249..726669453 100644 --- a/database/hook/update.go +++ b/database/hook/update.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/hook/update_test.go b/database/hook/update_test.go index cbb309897..2a630f65e 100644 --- a/database/hook/update_test.go +++ b/database/hook/update_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/log/log.go b/database/log/log.go index 35d25400f..b9c339580 100644 --- a/database/log/log.go +++ b/database/log/log.go @@ -40,9 +40,7 @@ type ( ) // New creates and returns a Vela service for integrating with logs in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (LogInterface, error) { // create new Log engine e := new(engine) diff --git a/database/log/log_test.go b/database/log/log_test.go index 69e3835d5..5166a0800 100644 --- a/database/log/log_test.go +++ b/database/log/log_test.go @@ -133,7 +133,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -142,7 +142,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres log engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -155,7 +155,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -164,7 +164,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite log engine: %v", err) } - return _engine + return _interface.(*engine) } // This will be used with the github.com/DATA-DOG/go-sqlmock diff --git a/database/pipeline/count.go b/database/pipeline/count.go index 67845adff..9f4be6d21 100644 --- a/database/pipeline/count.go +++ b/database/pipeline/count.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/count_repo.go b/database/pipeline/count_repo.go index 50de5cae7..914587a98 100644 --- a/database/pipeline/count_repo.go +++ b/database/pipeline/count_repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/count_repo_test.go b/database/pipeline/count_repo_test.go index cc3650d12..ac6f7d132 100644 --- a/database/pipeline/count_repo_test.go +++ b/database/pipeline/count_repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/count_test.go b/database/pipeline/count_test.go index bbc654fb5..92c04e483 100644 --- a/database/pipeline/count_test.go +++ b/database/pipeline/count_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/create.go b/database/pipeline/create.go index 424c24c23..5b84d776a 100644 --- a/database/pipeline/create.go +++ b/database/pipeline/create.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/create_test.go b/database/pipeline/create_test.go index 5a19c7e84..87a543eb3 100644 --- a/database/pipeline/create_test.go +++ b/database/pipeline/create_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/delete.go b/database/pipeline/delete.go index eb03db88c..f95f368a8 100644 --- a/database/pipeline/delete.go +++ b/database/pipeline/delete.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/delete_test.go b/database/pipeline/delete_test.go index 6bef174c7..8cca76336 100644 --- a/database/pipeline/delete_test.go +++ b/database/pipeline/delete_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/get.go b/database/pipeline/get.go index e8eb4b23a..87fe540df 100644 --- a/database/pipeline/get.go +++ b/database/pipeline/get.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/get_repo.go b/database/pipeline/get_repo.go index 1d431ca10..98e28d91c 100644 --- a/database/pipeline/get_repo.go +++ b/database/pipeline/get_repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/get_repo_test.go b/database/pipeline/get_repo_test.go index ab810ba5f..aef77650f 100644 --- a/database/pipeline/get_repo_test.go +++ b/database/pipeline/get_repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/get_test.go b/database/pipeline/get_test.go index f7c3565d3..5ccc81b02 100644 --- a/database/pipeline/get_test.go +++ b/database/pipeline/get_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/index.go b/database/pipeline/index.go index 506fddfa8..fd96352c7 100644 --- a/database/pipeline/index.go +++ b/database/pipeline/index.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/index_test.go b/database/pipeline/index_test.go index 1fa77b7b0..4e57da8a2 100644 --- a/database/pipeline/index_test.go +++ b/database/pipeline/index_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/interface.go b/database/pipeline/interface.go index c28c30da8..a39b8f7c0 100644 --- a/database/pipeline/interface.go +++ b/database/pipeline/interface.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/list.go b/database/pipeline/list.go index 9159a87aa..1f34f8d64 100644 --- a/database/pipeline/list.go +++ b/database/pipeline/list.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/list_repo.go b/database/pipeline/list_repo.go index 609dcc340..c87dfd704 100644 --- a/database/pipeline/list_repo.go +++ b/database/pipeline/list_repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/list_repo_test.go b/database/pipeline/list_repo_test.go index dc64e8a0f..830a5444e 100644 --- a/database/pipeline/list_repo_test.go +++ b/database/pipeline/list_repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/list_test.go b/database/pipeline/list_test.go index 36f65199d..4e4637230 100644 --- a/database/pipeline/list_test.go +++ b/database/pipeline/list_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/opts.go b/database/pipeline/opts.go index f04796ff7..e0172dbef 100644 --- a/database/pipeline/opts.go +++ b/database/pipeline/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/opts_test.go b/database/pipeline/opts_test.go index 94822e33b..951224b32 100644 --- a/database/pipeline/opts_test.go +++ b/database/pipeline/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/pipeline.go b/database/pipeline/pipeline.go index a48cc6e07..765508134 100644 --- a/database/pipeline/pipeline.go +++ b/database/pipeline/pipeline.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -40,9 +40,7 @@ type ( ) // New creates and returns a Vela service for integrating with pipelines in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (PipelineInterface, error) { // create new Pipeline engine e := new(engine) diff --git a/database/pipeline/pipeline_test.go b/database/pipeline/pipeline_test.go index f478fe37f..9fab9a102 100644 --- a/database/pipeline/pipeline_test.go +++ b/database/pipeline/pipeline_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -136,7 +136,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithCompressionLevel(0), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -146,7 +146,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres pipeline engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -159,7 +159,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithCompressionLevel(0), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -169,7 +169,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite pipeline engine: %v", err) } - return _engine + return _interface.(*engine) } // testPipeline is a test helper function to create a library diff --git a/database/pipeline/table.go b/database/pipeline/table.go index bc463da68..8231b06bf 100644 --- a/database/pipeline/table.go +++ b/database/pipeline/table.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/table_test.go b/database/pipeline/table_test.go index 5b05e4313..f2a51e08c 100644 --- a/database/pipeline/table_test.go +++ b/database/pipeline/table_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/update.go b/database/pipeline/update.go index 59b552164..a7fa98ab3 100644 --- a/database/pipeline/update.go +++ b/database/pipeline/update.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/pipeline/update_test.go b/database/pipeline/update_test.go index d321d63b5..03af5d70b 100644 --- a/database/pipeline/update_test.go +++ b/database/pipeline/update_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/count.go b/database/repo/count.go index 032e7d780..f112e98e2 100644 --- a/database/repo/count.go +++ b/database/repo/count.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/count_org.go b/database/repo/count_org.go index 938f151c6..719c7e864 100644 --- a/database/repo/count_org.go +++ b/database/repo/count_org.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/count_org_test.go b/database/repo/count_org_test.go index fd4797dad..6fae68bde 100644 --- a/database/repo/count_org_test.go +++ b/database/repo/count_org_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/count_test.go b/database/repo/count_test.go index 104cccc65..3030e62b8 100644 --- a/database/repo/count_test.go +++ b/database/repo/count_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/count_user.go b/database/repo/count_user.go index dbd226dac..a04aeea4e 100644 --- a/database/repo/count_user.go +++ b/database/repo/count_user.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/count_user_test.go b/database/repo/count_user_test.go index 45ea309ab..98203faea 100644 --- a/database/repo/count_user_test.go +++ b/database/repo/count_user_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/create.go b/database/repo/create.go index 850d854aa..abbcb8665 100644 --- a/database/repo/create.go +++ b/database/repo/create.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/create_test.go b/database/repo/create_test.go index 4241ce4ab..789edf042 100644 --- a/database/repo/create_test.go +++ b/database/repo/create_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/delete.go b/database/repo/delete.go index 64a515610..f8455b07a 100644 --- a/database/repo/delete.go +++ b/database/repo/delete.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/delete_test.go b/database/repo/delete_test.go index a4504d6bc..6ea206992 100644 --- a/database/repo/delete_test.go +++ b/database/repo/delete_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/get.go b/database/repo/get.go index 5a162ffb2..5634823f7 100644 --- a/database/repo/get.go +++ b/database/repo/get.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/get_org.go b/database/repo/get_org.go index f03260b99..bad8f69e1 100644 --- a/database/repo/get_org.go +++ b/database/repo/get_org.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/get_org_test.go b/database/repo/get_org_test.go index b60faefde..63e4f85b2 100644 --- a/database/repo/get_org_test.go +++ b/database/repo/get_org_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/get_test.go b/database/repo/get_test.go index e098626de..9b07d2d0f 100644 --- a/database/repo/get_test.go +++ b/database/repo/get_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/index.go b/database/repo/index.go index 2bc7c5ffa..1fa6258bb 100644 --- a/database/repo/index.go +++ b/database/repo/index.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/index_test.go b/database/repo/index_test.go index 90550cae8..6a17212b2 100644 --- a/database/repo/index_test.go +++ b/database/repo/index_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/interface.go b/database/repo/interface.go index 1b641da35..77dd7d28d 100644 --- a/database/repo/interface.go +++ b/database/repo/interface.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/list.go b/database/repo/list.go index 1b9b5d11c..1f3d03be6 100644 --- a/database/repo/list.go +++ b/database/repo/list.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/list_org.go b/database/repo/list_org.go index c673d2d88..bf173037c 100644 --- a/database/repo/list_org.go +++ b/database/repo/list_org.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/list_org_test.go b/database/repo/list_org_test.go index e54a11bf4..e085f4f57 100644 --- a/database/repo/list_org_test.go +++ b/database/repo/list_org_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/list_test.go b/database/repo/list_test.go index 6936406e6..aee8933a9 100644 --- a/database/repo/list_test.go +++ b/database/repo/list_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/list_user.go b/database/repo/list_user.go index a28a466aa..1bd4279ec 100644 --- a/database/repo/list_user.go +++ b/database/repo/list_user.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/list_user_test.go b/database/repo/list_user_test.go index 7bff6fe2c..0bece4d63 100644 --- a/database/repo/list_user_test.go +++ b/database/repo/list_user_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/opts.go b/database/repo/opts.go index 95957a598..7c802e43e 100644 --- a/database/repo/opts.go +++ b/database/repo/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/opts_test.go b/database/repo/opts_test.go index 78bfb826e..dced9f7fd 100644 --- a/database/repo/opts_test.go +++ b/database/repo/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/repo.go b/database/repo/repo.go index 1da6a8ab8..7f27ec606 100644 --- a/database/repo/repo.go +++ b/database/repo/repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -40,9 +40,7 @@ type ( ) // New creates and returns a Vela service for integrating with repos in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (RepoInterface, error) { // create new Repo engine e := new(engine) diff --git a/database/repo/repo_test.go b/database/repo/repo_test.go index 8729a56f7..933a99bb7 100644 --- a/database/repo/repo_test.go +++ b/database/repo/repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -136,7 +136,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithEncryptionKey("A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW"), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -146,7 +146,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres repo engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -159,7 +159,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithEncryptionKey("A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW"), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -169,7 +169,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite repo engine: %v", err) } - return _engine + return _interface.(*engine) } // testRepo is a test helper function to create a library diff --git a/database/repo/table.go b/database/repo/table.go index 1df91afff..b93e49996 100644 --- a/database/repo/table.go +++ b/database/repo/table.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/table_test.go b/database/repo/table_test.go index 7680c02d6..83f0c42cf 100644 --- a/database/repo/table_test.go +++ b/database/repo/table_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/update.go b/database/repo/update.go index cf7111499..04556ad72 100644 --- a/database/repo/update.go +++ b/database/repo/update.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/repo/update_test.go b/database/repo/update_test.go index 66f4fa6a9..948e3335e 100644 --- a/database/repo/update_test.go +++ b/database/repo/update_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/schedule/schedule.go b/database/schedule/schedule.go index 0517dcae9..f8057661f 100644 --- a/database/schedule/schedule.go +++ b/database/schedule/schedule.go @@ -38,9 +38,7 @@ type ( ) // New creates and returns a Vela service for integrating with schedules in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (ScheduleInterface, error) { // create new Schedule engine e := new(engine) diff --git a/database/schedule/schedule_test.go b/database/schedule/schedule_test.go index fc4b4c6e1..23792c5a2 100644 --- a/database/schedule/schedule_test.go +++ b/database/schedule/schedule_test.go @@ -134,7 +134,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -143,7 +143,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres schedule engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -156,7 +156,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -165,7 +165,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite schedule engine: %v", err) } - return _engine + return _interface.(*engine) } // testSchedule is a test helper function to create an API Schedule type with all fields set to their zero values. diff --git a/database/secret/secret.go b/database/secret/secret.go index fa342f5d5..ce9ae1bdf 100644 --- a/database/secret/secret.go +++ b/database/secret/secret.go @@ -40,9 +40,7 @@ type ( ) // New creates and returns a Vela service for integrating with secrets in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (SecretInterface, error) { // create new Secret engine e := new(engine) diff --git a/database/secret/secret_test.go b/database/secret/secret_test.go index 0d6a61c25..476d7f3e8 100644 --- a/database/secret/secret_test.go +++ b/database/secret/secret_test.go @@ -141,7 +141,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithEncryptionKey("A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW"), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -151,7 +151,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres secret engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -164,7 +164,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithEncryptionKey("A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW"), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -174,7 +174,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite secret engine: %v", err) } - return _engine + return _interface.(*engine) } // testRepo is a test helper function to create a library diff --git a/database/service/count_build_test.go b/database/service/count_build_test.go index 08c964da7..019a3fa6f 100644 --- a/database/service/count_build_test.go +++ b/database/service/count_build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/service/service.go b/database/service/service.go index 548164c0f..fb6b2ca91 100644 --- a/database/service/service.go +++ b/database/service/service.go @@ -38,9 +38,7 @@ type ( ) // New creates and returns a Vela service for integrating with services in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (ServiceInterface, error) { // create new Service engine e := new(engine) diff --git a/database/service/service_test.go b/database/service/service_test.go index c9d658769..817f4d6ab 100644 --- a/database/service/service_test.go +++ b/database/service/service_test.go @@ -132,7 +132,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -141,7 +141,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres service engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -154,7 +154,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -163,7 +163,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite service engine: %v", err) } - return _engine + return _interface.(*engine) } // testBuild is a test helper function to create a library diff --git a/database/step/count_build_test.go b/database/step/count_build_test.go index 401e1d6b3..1eee00409 100644 --- a/database/step/count_build_test.go +++ b/database/step/count_build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/step/step.go b/database/step/step.go index 43e905797..90eb24be4 100644 --- a/database/step/step.go +++ b/database/step/step.go @@ -38,9 +38,7 @@ type ( ) // New creates and returns a Vela service for integrating with steps in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (StepInterface, error) { // create new Step engine e := new(engine) diff --git a/database/step/step_test.go b/database/step/step_test.go index 136d5ca40..dbdafd1c5 100644 --- a/database/step/step_test.go +++ b/database/step/step_test.go @@ -132,7 +132,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -141,7 +141,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres step engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -154,7 +154,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -163,7 +163,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite step engine: %v", err) } - return _engine + return _interface.(*engine) } // testBuild is a test helper function to create a library diff --git a/database/user/count.go b/database/user/count.go index 074a5ef66..1be6308c8 100644 --- a/database/user/count.go +++ b/database/user/count.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/count_test.go b/database/user/count_test.go index be7cb6437..e0b757bff 100644 --- a/database/user/count_test.go +++ b/database/user/count_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/create.go b/database/user/create.go index f527979b9..6b23a53f8 100644 --- a/database/user/create.go +++ b/database/user/create.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/create_test.go b/database/user/create_test.go index 12de80f96..97a818dd0 100644 --- a/database/user/create_test.go +++ b/database/user/create_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/delete.go b/database/user/delete.go index 95b77ff64..a081023d7 100644 --- a/database/user/delete.go +++ b/database/user/delete.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/delete_test.go b/database/user/delete_test.go index 0dec0a6b2..946a6c0c5 100644 --- a/database/user/delete_test.go +++ b/database/user/delete_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/get.go b/database/user/get.go index d37275c80..c62b8d80d 100644 --- a/database/user/get.go +++ b/database/user/get.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/get_name.go b/database/user/get_name.go index 4e8da5550..42a1a4f70 100644 --- a/database/user/get_name.go +++ b/database/user/get_name.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/get_name_test.go b/database/user/get_name_test.go index 4b0a6446b..0b3d829a5 100644 --- a/database/user/get_name_test.go +++ b/database/user/get_name_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/get_test.go b/database/user/get_test.go index 4593ce48f..23d8c7024 100644 --- a/database/user/get_test.go +++ b/database/user/get_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/index.go b/database/user/index.go index 5445e963e..51f1eec72 100644 --- a/database/user/index.go +++ b/database/user/index.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/index_test.go b/database/user/index_test.go index 55728b77a..61cde5e5a 100644 --- a/database/user/index_test.go +++ b/database/user/index_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/interface.go b/database/user/interface.go index ad5986fad..b68959056 100644 --- a/database/user/interface.go +++ b/database/user/interface.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/list.go b/database/user/list.go index 4bc730f27..299ca95c6 100644 --- a/database/user/list.go +++ b/database/user/list.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/list_lite.go b/database/user/list_lite.go index ee90bca3b..46d661a5b 100644 --- a/database/user/list_lite.go +++ b/database/user/list_lite.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/list_lite_test.go b/database/user/list_lite_test.go index 4c44bc20b..84d75c458 100644 --- a/database/user/list_lite_test.go +++ b/database/user/list_lite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/list_test.go b/database/user/list_test.go index 61293d44c..a0b333ef7 100644 --- a/database/user/list_test.go +++ b/database/user/list_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/opts.go b/database/user/opts.go index 58780c317..9caf4bc07 100644 --- a/database/user/opts.go +++ b/database/user/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/opts_test.go b/database/user/opts_test.go index 77fb9ae23..b4b951de6 100644 --- a/database/user/opts_test.go +++ b/database/user/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/table.go b/database/user/table.go index 456853770..c3b036882 100644 --- a/database/user/table.go +++ b/database/user/table.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/table_test.go b/database/user/table_test.go index 95a2d4c00..1d880e559 100644 --- a/database/user/table_test.go +++ b/database/user/table_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/update.go b/database/user/update.go index c7efc5e7f..a37681a7f 100644 --- a/database/user/update.go +++ b/database/user/update.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/update_test.go b/database/user/update_test.go index 4253ac435..89f261c4c 100644 --- a/database/user/update_test.go +++ b/database/user/update_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/user/user.go b/database/user/user.go index 99e1f9701..60e4ab671 100644 --- a/database/user/user.go +++ b/database/user/user.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -40,9 +40,7 @@ type ( ) // New creates and returns a Vela service for integrating with users in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (UserInterface, error) { // create new User engine e := new(engine) diff --git a/database/user/user_test.go b/database/user/user_test.go index 1586103a7..999afdb47 100644 --- a/database/user/user_test.go +++ b/database/user/user_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -136,7 +136,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithEncryptionKey("A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW"), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -146,7 +146,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres user engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -159,7 +159,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithEncryptionKey("A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW"), WithLogger(logrus.NewEntry(logrus.StandardLogger())), @@ -169,7 +169,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite user engine: %v", err) } - return _engine + return _interface.(*engine) } // testUser is a test helper function to create a library diff --git a/database/worker/count.go b/database/worker/count.go index 8ac0f3eb5..0a3769eec 100644 --- a/database/worker/count.go +++ b/database/worker/count.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/count_test.go b/database/worker/count_test.go index bd9d4c4ac..6c7817175 100644 --- a/database/worker/count_test.go +++ b/database/worker/count_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/create.go b/database/worker/create.go index 6c62b30b6..0b30365c4 100644 --- a/database/worker/create.go +++ b/database/worker/create.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/create_test.go b/database/worker/create_test.go index e4c4dc9cb..7b17e6b98 100644 --- a/database/worker/create_test.go +++ b/database/worker/create_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/delete.go b/database/worker/delete.go index a04ebb13e..3fdf6e79c 100644 --- a/database/worker/delete.go +++ b/database/worker/delete.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/delete_test.go b/database/worker/delete_test.go index c8a9bd1be..7780746ab 100644 --- a/database/worker/delete_test.go +++ b/database/worker/delete_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/get.go b/database/worker/get.go index dd2b07ecc..7c8f9e5f7 100644 --- a/database/worker/get.go +++ b/database/worker/get.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/get_hostname.go b/database/worker/get_hostname.go index 6bcf42a2b..a5cf64de6 100644 --- a/database/worker/get_hostname.go +++ b/database/worker/get_hostname.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/get_hostname_test.go b/database/worker/get_hostname_test.go index 3dd1d4fe6..184a78d4a 100644 --- a/database/worker/get_hostname_test.go +++ b/database/worker/get_hostname_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/get_test.go b/database/worker/get_test.go index 17fd03739..898ed7b5e 100644 --- a/database/worker/get_test.go +++ b/database/worker/get_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/index.go b/database/worker/index.go index f8f01a4b6..c091d2946 100644 --- a/database/worker/index.go +++ b/database/worker/index.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/index_test.go b/database/worker/index_test.go index ead204e5c..7141687d5 100644 --- a/database/worker/index_test.go +++ b/database/worker/index_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/interface.go b/database/worker/interface.go index 9e7fe1169..db7701bfc 100644 --- a/database/worker/interface.go +++ b/database/worker/interface.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/list.go b/database/worker/list.go index 4ec11ef3d..ef691e2c0 100644 --- a/database/worker/list.go +++ b/database/worker/list.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/list_test.go b/database/worker/list_test.go index 5eed3f94f..a3c5cdeff 100644 --- a/database/worker/list_test.go +++ b/database/worker/list_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/opts.go b/database/worker/opts.go index c9891ba94..3a9d197ca 100644 --- a/database/worker/opts.go +++ b/database/worker/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/opts_test.go b/database/worker/opts_test.go index a0ebf6aa5..7f42677d1 100644 --- a/database/worker/opts_test.go +++ b/database/worker/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/table.go b/database/worker/table.go index 1d704674a..e3aa2c8ff 100644 --- a/database/worker/table.go +++ b/database/worker/table.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/table_test.go b/database/worker/table_test.go index 681a267f2..36d1b16af 100644 --- a/database/worker/table_test.go +++ b/database/worker/table_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/update.go b/database/worker/update.go index b0e475273..7e255b493 100644 --- a/database/worker/update.go +++ b/database/worker/update.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/update_test.go b/database/worker/update_test.go index 0beeafa47..4a81efdcb 100644 --- a/database/worker/update_test.go +++ b/database/worker/update_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/database/worker/worker.go b/database/worker/worker.go index d18aa6408..89b31711c 100644 --- a/database/worker/worker.go +++ b/database/worker/worker.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -38,9 +38,7 @@ type ( ) // New creates and returns a Vela service for integrating with workers in the database. -// -//nolint:revive // ignore returning unexported engine -func New(opts ...EngineOpt) (*engine, error) { +func New(opts ...EngineOpt) (WorkerInterface, error) { // create new Worker engine e := new(engine) diff --git a/database/worker/worker_test.go b/database/worker/worker_test.go index 00096c2a9..b66f301dd 100644 --- a/database/worker/worker_test.go +++ b/database/worker/worker_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -132,7 +132,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_postgres), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -141,7 +141,7 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { t.Errorf("unable to create new postgres worker engine: %v", err) } - return _engine, _mock + return _interface.(*engine), _mock } // testSqlite is a helper function to create a Sqlite engine for testing. @@ -154,7 +154,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite database: %v", err) } - _engine, err := New( + _interface, err := New( WithClient(_sqlite), WithLogger(logrus.NewEntry(logrus.StandardLogger())), WithSkipCreation(false), @@ -163,7 +163,7 @@ func testSqlite(t *testing.T) *engine { t.Errorf("unable to create new sqlite worker engine: %v", err) } - return _engine + return _interface.(*engine) } // testWorker is a test helper function to create a library