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

Commit

Permalink
feat: initial version of provider v2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgacsal committed Feb 15, 2024
1 parent cc0e405 commit b7753ef
Show file tree
Hide file tree
Showing 12 changed files with 438 additions and 0 deletions.
31 changes: 31 additions & 0 deletions provider/v2/aws/discoverer/discoverer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package discoverer

import (
"context"

"github.com/openclarity/vmclarity/provider"
)

var _ provider.Discoverer = &Discoverer{}

type Discoverer struct{}

func (d *Discoverer) DiscoverAssets(ctx context.Context) provider.AssetDiscoverer {
// TODO implement me
panic("implement me")
}
32 changes: 32 additions & 0 deletions provider/v2/aws/estimator/estimator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package estimator

import (
"context"

apitypes "github.com/openclarity/vmclarity/api/types"
"github.com/openclarity/vmclarity/provider"
)

var _ provider.Estimator = &Estimator{}

type Estimator struct{}

func (e *Estimator) Estimate(ctx context.Context, stats apitypes.AssetScanStats, asset *apitypes.Asset, template *apitypes.AssetScanTemplate) (*apitypes.Estimation, error) {
// TODO implement me
panic("implement me")
}
47 changes: 47 additions & 0 deletions provider/v2/aws/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package aws

import (
"context"

apitypes "github.com/openclarity/vmclarity/api/types"
"github.com/openclarity/vmclarity/provider"
"github.com/openclarity/vmclarity/provider/v2/aws/discoverer"
"github.com/openclarity/vmclarity/provider/v2/aws/estimator"
"github.com/openclarity/vmclarity/provider/v2/aws/scanner"
)

var _ provider.Provider = &Provider{}

type Provider struct {
*discoverer.Discoverer
*scanner.Scanner
*estimator.Estimator
}

func (p *Provider) Kind() apitypes.CloudProvider {
// TODO implement me
panic("implement me")
}

func New(_ context.Context) (provider.Provider, error) {
return &Provider{
Discoverer: &discoverer.Discoverer{},
Scanner: &scanner.Scanner{},
Estimator: &estimator.Estimator{},
}, nil
}
36 changes: 36 additions & 0 deletions provider/v2/aws/scanner/scanner.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package scanner

import (
"context"

"github.com/openclarity/vmclarity/provider"
)

var _ provider.Scanner = &Scanner{}

type Scanner struct{}

func (s *Scanner) RunAssetScan(ctx context.Context, t *provider.ScanJobConfig) error {
// TODO implement me
panic("implement me")
}

func (s *Scanner) RemoveAssetScan(ctx context.Context, t *provider.ScanJobConfig) error {
// TODO implement me
panic("implement me")
}
31 changes: 31 additions & 0 deletions provider/v2/azure/discoverer/discoverer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package discoverer

import (
"context"

"github.com/openclarity/vmclarity/provider"
)

var _ provider.Discoverer = &Discoverer{}

type Discoverer struct{}

func (d *Discoverer) DiscoverAssets(ctx context.Context) provider.AssetDiscoverer {
// TODO implement me
panic("implement me")
}
32 changes: 32 additions & 0 deletions provider/v2/azure/estimator/estimator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package estimator

import (
"context"

apitypes "github.com/openclarity/vmclarity/api/types"
"github.com/openclarity/vmclarity/provider"
)

var _ provider.Estimator = &Estimator{}

type Estimator struct{}

func (e *Estimator) Estimate(ctx context.Context, stats apitypes.AssetScanStats, asset *apitypes.Asset, template *apitypes.AssetScanTemplate) (*apitypes.Estimation, error) {
// TODO implement me
panic("implement me")
}
47 changes: 47 additions & 0 deletions provider/v2/azure/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package azure

import (
"context"

apitypes "github.com/openclarity/vmclarity/api/types"
"github.com/openclarity/vmclarity/provider"
"github.com/openclarity/vmclarity/provider/v2/aws/discoverer"
"github.com/openclarity/vmclarity/provider/v2/aws/estimator"
"github.com/openclarity/vmclarity/provider/v2/aws/scanner"
)

var _ provider.Provider = &Provider{}

type Provider struct {
*discoverer.Discoverer
*scanner.Scanner
*estimator.Estimator
}

func (p *Provider) Kind() apitypes.CloudProvider {
// TODO implement me
panic("implement me")
}

func New(_ context.Context) (*Provider, error) {
return &Provider{
Discoverer: &discoverer.Discoverer{},
Scanner: &scanner.Scanner{},
Estimator: &estimator.Estimator{},
}, nil
}
36 changes: 36 additions & 0 deletions provider/v2/azure/scanner/scanner.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package scanner

import (
"context"

"github.com/openclarity/vmclarity/provider"
)

var _ provider.Scanner = &Scanner{}

type Scanner struct{}

func (s *Scanner) RunAssetScan(ctx context.Context, t *provider.ScanJobConfig) error {
// TODO implement me
panic("implement me")
}

func (s *Scanner) RemoveAssetScan(ctx context.Context, t *provider.ScanJobConfig) error {
// TODO implement me
panic("implement me")
}
31 changes: 31 additions & 0 deletions provider/v2/gcp/discoverer/discoverer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package discoverer

import (
"context"

"github.com/openclarity/vmclarity/provider"
)

var _ provider.Discoverer = &Discoverer{}

type Discoverer struct{}

func (d *Discoverer) DiscoverAssets(ctx context.Context) provider.AssetDiscoverer {
// TODO implement me
panic("implement me")
}
32 changes: 32 additions & 0 deletions provider/v2/gcp/estimator/estimator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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.

package estimator

import (
"context"

apitypes "github.com/openclarity/vmclarity/api/types"
"github.com/openclarity/vmclarity/provider"
)

var _ provider.Estimator = &Estimator{}

type Estimator struct{}

func (e *Estimator) Estimate(ctx context.Context, stats apitypes.AssetScanStats, asset *apitypes.Asset, template *apitypes.AssetScanTemplate) (*apitypes.Estimation, error) {
// TODO implement me
panic("implement me")
}
Loading

0 comments on commit b7753ef

Please sign in to comment.