resourcesservice

package
v1.0.47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

the resource service package provides services to get and manipulate resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResourceExist

func CheckResourceExist(ctx context.Context, uid string) bool

CheckResourceExist checks whether a resource with the provided `uid` exists in the MongoDB database. The function uses the `resourcesmongodbrepo.ResourceExistbyUid` function to query the database and returns `true` if a matching resource is found, otherwise it returns `false`.

func GetAppProjectByUid

Functions to get Appprojects by uid,ownerref The function is intended for use by internal functions

func GetApplicationByUid

Functions to get Applications by uid,ownerref The function is intended for use by internal functions

func GetApplications

Functions to get Applications by ownerref The function is intended for use by internal functions

func GetAppprojects

Functions to get Appprojects by ownerref The function is intended for use by internal functions

func GetCertificateByUid

Functions to get Certificates by uid,ownerref The function is intended for use by internal functions

func GetCertificates

Functions to get Certificates by ownerref The function is intended for use by internal functions

func GetClusterComplianceReportByUid

Functions to get Clustercompliancereports by uid,ownerref The function is intended for use by internal functions

func GetClusterOrderByUid

Functions to get Clusterorders by uid,ownerref The function is intended for use by internal functions

func GetClusterVulnerabilityReportByUid

Functions to get Clustervulnerabilityreports by uid,ownerref The function is intended for use by internal functions

func GetClustercompliancereports

Functions to get Clustercompliancereports by ownerref The function is intended for use by internal functions

func GetClusterorders

Functions to get Clusterorders by ownerref The function is intended for use by internal functions

func GetClustervulnerabilityreports

Functions to get Clustervulnerabilityreports by ownerref The function is intended for use by internal functions

func GetConfigAuditReportByUid

Functions to get Configauditreports by uid,ownerref The function is intended for use by internal functions

func GetConfigauditreports

Functions to get Configauditreports by ownerref The function is intended for use by internal functions

func GetConfigurationByUid

Functions to get Configurations by uid,ownerref The function is intended for use by internal functions

func GetConfigurations

Functions to get Configurations by ownerref The function is intended for use by internal functions

func GetDaemonSetByUid

Functions to get Daemonsets by uid,ownerref The function is intended for use by internal functions

func GetDaemonsets

Functions to get Daemonsets by ownerref The function is intended for use by internal functions

func GetDeploymentByUid

Functions to get Deployments by uid,ownerref The function is intended for use by internal functions

func GetDeployments

Functions to get Deployments by ownerref The function is intended for use by internal functions

func GetEndpoints

Functions to get Endpoints by ownerref The function is intended for use by internal functions

func GetEndpointsByUid

Functions to get Endpoints by uid,ownerref The function is intended for use by internal functions

func GetExposedSecretReportByUid

Functions to get Exposedsecretreports by uid,ownerref The function is intended for use by internal functions

func GetExposedsecretreports

Functions to get Exposedsecretreports by ownerref The function is intended for use by internal functions

func GetIngressByUid

Functions to get Ingresses by uid,ownerref The function is intended for use by internal functions

func GetIngressClassByUid

Functions to get Ingressclasses by uid,ownerref The function is intended for use by internal functions

func GetIngressclasses

Functions to get Ingressclasses by ownerref The function is intended for use by internal functions

func GetIngresses

Functions to get Ingresses by ownerref The function is intended for use by internal functions

func GetKubernetesClusterByUid

Functions to get Kubernetesclusters by uid,ownerref The function is intended for use by internal functions

func GetKubernetesclusters

Functions to get Kubernetesclusters by ownerref The function is intended for use by internal functions

func GetNamespaceByUid

Functions to get Namespaces by uid,ownerref The function is intended for use by internal functions

func GetNamespaces

Functions to get Namespaces by ownerref The function is intended for use by internal functions

func GetNetworkPolicyByUid

Functions to get Networkpolicies by uid,ownerref The function is intended for use by internal functions

func GetNetworkpolicies

Functions to get Networkpolicies by ownerref The function is intended for use by internal functions

func GetNodeByUid

Functions to get Nodes by uid,ownerref The function is intended for use by internal functions

func GetNodes

Functions to get Nodes by ownerref The function is intended for use by internal functions

func GetPersistentVolumeClaimByUid

Functions to get Persistentvolumeclaims by uid,ownerref The function is intended for use by internal functions

func GetPersistentvolumeclaims

Functions to get Persistentvolumeclaims by ownerref The function is intended for use by internal functions

func GetPodByUid

Functions to get Pods by uid,ownerref The function is intended for use by internal functions

func GetPods

Functions to get Pods by ownerref The function is intended for use by internal functions

func GetPolicyReportByUid

Functions to get Policyreports by uid,ownerref The function is intended for use by internal functions

func GetPolicyreports

Functions to get Policyreports by ownerref The function is intended for use by internal functions

func GetProjectByUid

Functions to get Projects by uid,ownerref The function is intended for use by internal functions

func GetProjects

Functions to get Projects by ownerref The function is intended for use by internal functions

func GetRbacAssessmentReportByUid

Functions to get Rbacassessmentreports by uid,ownerref The function is intended for use by internal functions

func GetRbacassessmentreports

Functions to get Rbacassessmentreports by ownerref The function is intended for use by internal functions

func GetReplicaSetByUid

Functions to get Replicasets by uid,ownerref The function is intended for use by internal functions

func GetReplicasets

Functions to get Replicasets by ownerref The function is intended for use by internal functions

func GetResource

Get one resource by query (owner/apiVersion/Kind/uid)

func GetResources

GetResources retrieves resources of type `T` from Mongo DB based on the provided `ResourceQuery`. The function queries the `resourcesmongodbrepo` using `GetResourcesByQuery[T]` method and returns a slice of the retrieved resources if successful. The function returns an error if the resource retrieval process fails.

func GetRouteByUid

Functions to get Routes by uid,ownerref The function is intended for use by internal functions

func GetRoutes

Functions to get Routes by ownerref The function is intended for use by internal functions

func GetServiceByUid

Functions to get Services by uid,ownerref The function is intended for use by internal functions

func GetServices

Functions to get Services by ownerref The function is intended for use by internal functions

func GetSlackMessageByUid

Functions to get Slackmessages by uid,ownerref The function is intended for use by internal functions

func GetSlackmessages

Functions to get Slackmessages by ownerref The function is intended for use by internal functions

func GetStatefulSetByUid

Functions to get Statefulsets by uid,ownerref The function is intended for use by internal functions

func GetStatefulsets

Functions to get Statefulsets by ownerref The function is intended for use by internal functions

func GetStorageClassByUid

Functions to get Storageclasses by uid,ownerref The function is intended for use by internal functions

func GetStorageclasses

Functions to get Storageclasses by ownerref The function is intended for use by internal functions

func GetTanzuKubernetesClusterByUid

Functions to get Tanzukubernetesclusters by uid,ownerref The function is intended for use by internal functions

func GetTanzuKubernetesReleaseByUid

Functions to get Tanzukubernetesreleases by uid,ownerref The function is intended for use by internal functions

func GetTanzukubernetesclusters

Functions to get Tanzukubernetesclusters by ownerref The function is intended for use by internal functions

func GetTanzukubernetesreleases

Functions to get Tanzukubernetesreleases by ownerref The function is intended for use by internal functions

func GetVirtualMachineByUid

Functions to get Virtualmachines by uid,ownerref The function is intended for use by internal functions

func GetVirtualMachineClassBindingByUid

Functions to get Virtualmachineclassbindings by uid,ownerref The function is intended for use by internal functions

func GetVirtualMachineClassByUid

Functions to get Virtualmachineclasses by uid,ownerref The function is intended for use by internal functions

func GetVirtualmachineclassbindings

Functions to get Virtualmachineclassbindings by ownerref The function is intended for use by internal functions

func GetVirtualmachineclasses

Functions to get Virtualmachineclasses by ownerref The function is intended for use by internal functions

func GetVirtualmachines

Functions to get Virtualmachines by ownerref The function is intended for use by internal functions

func GetVulnerabilityEventByUid

Functions to get Vulnerabilityevents by uid,ownerref The function is intended for use by internal functions

func GetVulnerabilityReportByUid

Functions to get Vulnerabilityreports by uid,ownerref The function is intended for use by internal functions

func GetVulnerabilityevents

Functions to get Vulnerabilityevents by ownerref The function is intended for use by internal functions

func GetVulnerabilityreports

Functions to get Vulnerabilityreports by ownerref The function is intended for use by internal functions

func PatchResource

func PatchResource(ctx context.Context, uid string, resourceUpdate bson.M) (mongo.UpdateResult, error)

PatchResource updates a resource in the MongoDB database based on the provided `ResourceQuery` and `ResourceUpdateModel`. The function returns an error if the resource update process fails. The resourceUpdate parameter is a `bson.M` type which should be flattened to the following format:

bson.M{
    "metadata.name": "test",
}

This function is inteded used by internal functions and does not perform any validation on the provided parameters.

func ResourceCreateService

func ResourceCreateService(ctx context.Context, resourceUpdate apiresourcecontracts.ResourceUpdateModel) error

Function to creates a resource by the 'apiresourcecontracts.ResourceUpdateModel'

func ResourceDeleteService

func ResourceDeleteService(ctx context.Context, resourceUpdate apiresourcecontracts.ResourceUpdateModel) error

Function deletes a resource

func ResourceGetHashlist

returns the list of hashes owned by the ownerref

func ResourceNewCreateService

func ResourceNewCreateService(ctx context.Context, resourceUpdate apiresourcecontracts.ResourceUpdateModel) error

wrapper to allow create to update if hashlist is bugged or download failed

func ResourceUpdateService

func ResourceUpdateService(ctx context.Context, resourceUpdate apiresourcecontracts.ResourceUpdateModel) error

Function to update a resource by the 'apiresourcecontracts.ResourceUpdateModel' struct

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL