This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 573c468c [operator] Adding schemaimpl logic
573c468c is described below

commit 573c468c862dc69c4e6bc1fbed111151acd69ea5
Author: mfordjody <[email protected]>
AuthorDate: Tue Dec 17 09:42:53 2024 +0800

    [operator] Adding schemaimpl logic
---
 pkg/kube/collection/schemas.go |  7 +++++++
 pkg/schema/schema.go           | 25 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/pkg/kube/collection/schemas.go b/pkg/kube/collection/schemas.go
new file mode 100644
index 00000000..2a824e3a
--- /dev/null
+++ b/pkg/kube/collection/schemas.go
@@ -0,0 +1,7 @@
+package collection
+
+type Schemas struct {
+}
+
+type SchemasBuilder struct {
+}
\ No newline at end of file
diff --git a/pkg/schema/schema.go b/pkg/schema/schema.go
index d54f4142..bc479e38 100644
--- a/pkg/schema/schema.go
+++ b/pkg/schema/schema.go
@@ -1,6 +1,7 @@
 package schema
 
 import (
+       "fmt"
        "github.com/apache/dubbo-kubernetes/operator/pkg/config"
        "k8s.io/apimachinery/pkg/runtime/schema"
 )
@@ -9,6 +10,8 @@ type schemaImpl struct {
        gvk           config.GroupVersionKind
        plural        string
        clusterScoped bool
+       goPkg         string
+       proto         string
 }
 
 func (s *schemaImpl) Kind() string {
@@ -35,6 +38,10 @@ func (s *schemaImpl) InClusterScoped() bool {
        return s.clusterScoped
 }
 
+func (s *schemaImpl) String() string {
+       return fmt.Sprintf("[Schema](%s, %q, %s)", s.Kind(), s.goPkg, s.proto)
+}
+
 func (s *schemaImpl) GroupVersionResource() schema.GroupVersionResource {
        return schema.GroupVersionResource{
                Group:    s.Group(),
@@ -43,6 +50,24 @@ func (s *schemaImpl) GroupVersionResource() 
schema.GroupVersionResource {
        }
 }
 
+func (s *schemaImpl) Validate() (err error) {
+       return
+}
+
 type Builder struct {
 }
 
+func (b Builder) BuildNoValidate() Schema {
+}
+
+func (b Builder) Build() (Schema, error) {
+}
+
+type Schema interface {
+       fmt.Stringer
+       GroupVersionResource() schema.GroupVersionResource
+       GroupVersionKind() schema.GroupVersionKind
+       GroupVersionAliasKinds() []config.GroupVersionKind
+       Validate() error
+       IsClusterScoped() bool
+}

Reply via email to