kubesphere.io/api@v0.0.0-20231107125330-c9a03957060c/alerting/v2beta1/register.go (about)

     1  /*
     2  Copyright 2020 KubeSphere Authors
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8       http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  /*
    18  
    19  Licensed under the Apache License, Version 2.0 (the "License");
    20  you may not use this file except in compliance with the License.
    21  You may obtain a copy of the License at
    22  
    23      http://www.apache.org/licenses/LICENSE-2.0
    24  
    25  Unless required by applicable law or agreed to in writing, software
    26  distributed under the License is distributed on an "AS IS" BASIS,
    27  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    28  See the License for the specific language governing permissions and
    29  limitations under the License.
    30  */
    31  
    32  // Package v2beta1 contains API Schema definitions for the alerting v2beta1 API group
    33  // +kubebuilder:object:generate=true
    34  // +groupName=alerting.kubesphere.io
    35  package v2beta1
    36  
    37  import (
    38  	"k8s.io/apimachinery/pkg/runtime/schema"
    39  	"sigs.k8s.io/controller-runtime/pkg/scheme"
    40  )
    41  
    42  var (
    43  	// GroupVersion is group version used to register these objects
    44  	SchemeGroupVersion = schema.GroupVersion{Group: "alerting.kubesphere.io", Version: "v2beta1"}
    45  
    46  	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
    47  	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
    48  
    49  	// AddToScheme adds the types in this group-version to the given scheme.
    50  	AddToScheme = SchemeBuilder.AddToScheme
    51  )
    52  
    53  func Resource(resource string) schema.GroupResource {
    54  	return SchemeGroupVersion.WithResource(resource).GroupResource()
    55  }