Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Move ui_backend to pkg/uibackend (#492)
Browse files Browse the repository at this point in the history
This is the fifth commit in the chain for reorganising under a common
cmd and pkg directory structure. This commit moves ui_backend
package into pkg/uibackend. The underscore is dropped because golang
package names shouldn't have underscores in them.
  • Loading branch information
Sam Betts authored Jul 31, 2023
1 parent 4bde9d6 commit 81071aa
Show file tree
Hide file tree
Showing 23 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .licensei.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ignored = [
]

[header]
ignorePaths = ["api","ui_backend/api"]
ignorePaths = ["api","pkg/uibackend/api"]
ignoreFiles = ["*mock_*.go","*.pb.go"]
template = """// Copyright © :YEAR: Cisco Systems, Inc. and its affiliates.
// All rights reserved.
Expand All @@ -29,4 +29,4 @@ template = """// Copyright © :YEAR: Cisco Systems, Inc. and its affiliates.
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License."""
// limitations under the License."""
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ api-backend: ## Generating API for backend code
.PHONY: api-ui
api-ui: ## Generating API for UI backend code
@(echo "Generating API for UI backend code ..." )
@(cd ui_backend/api; go generate)
@(cd pkg/uibackend/api; go generate)
2 changes: 1 addition & 1 deletion pkg/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/openclarity/vmclarity/pkg/orchestrator"
"github.com/openclarity/vmclarity/pkg/shared/backendclient"
"github.com/openclarity/vmclarity/pkg/shared/log"
uibackend "github.com/openclarity/vmclarity/ui_backend/pkg/rest"
uibackend "github.com/openclarity/vmclarity/pkg/uibackend/rest"
)

func createDatabaseConfig(config *_config.Config) databaseTypes.DBConfig {
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/rest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"github.com/openclarity/vmclarity/pkg/backend/common"
databaseTypes "github.com/openclarity/vmclarity/pkg/backend/database/types"
"github.com/openclarity/vmclarity/pkg/shared/log"
uiserver "github.com/openclarity/vmclarity/ui_backend/api/server"
uirest "github.com/openclarity/vmclarity/ui_backend/pkg/rest"
uiserver "github.com/openclarity/vmclarity/pkg/uibackend/api/server"
uirest "github.com/openclarity/vmclarity/pkg/uibackend/rest"
)

const (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package: client
output: client/client.gen.go
additional-imports:
- package: github.com/openclarity/vmclarity/ui_backend/api/models
- package: github.com/openclarity/vmclarity/pkg/uibackend/api/models
alias: .
generate:
client: true
output-options:
skip-prune: true
skip-prune: true

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package: server
output: server/server.gen.go
additional-imports:
- package: github.com/openclarity/vmclarity/ui_backend/api/models
- package: github.com/openclarity/vmclarity/pkg/uibackend/api/models
alias: .
generate:
echo-server: true
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"

"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

// nolint:wrapcheck,unparam
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
backendmodels "github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/pkg/shared/findingkey"
"github.com/openclarity/vmclarity/pkg/shared/utils"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
backendmodels "github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/pkg/shared/findingkey"
"github.com/openclarity/vmclarity/pkg/shared/utils"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

func Test_processFindings(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

backendmodels "github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/pkg/shared/utils"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/google/go-cmp/cmp"
"gotest.tools/v3/assert"

"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

func Test_createTimes(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

backendmodels "github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/pkg/shared/utils"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

backendmodels "github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/pkg/shared/utils"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

func Test_getTotalFindingField(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

backendmodels "github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/pkg/shared/utils"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

func (s *ServerImpl) GetDashboardRiskiestRegions(ctx echo.Context) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

backendmodels "github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/pkg/shared/utils"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"github.com/openclarity/vmclarity/pkg/uibackend/api/models"
)

func Test_getAssetLocation(t *testing.T) {
Expand Down
File renamed without changes.

0 comments on commit 81071aa

Please sign in to comment.