@@ -23,6 +23,23 @@ import (
23
23
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24
24
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25
25
26
+ // BackendType 是后端服务类型
27
+ type BackendType string
28
+
29
+ const (
30
+ APP BackendType = "app"
31
+ BUCKET BackendType = "bucket"
32
+ WEBSITE BackendType = "website"
33
+ )
34
+
35
+ // RouteState 是路由的状态
36
+ type RouteState string
37
+
38
+ const (
39
+ PREPARING RouteState = "preparing"
40
+ CREATED RouteState = "created"
41
+ )
42
+
26
43
// GatewaySpec defines the desired state of Gateway
27
44
type GatewaySpec struct {
28
45
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
@@ -33,7 +50,7 @@ type GatewaySpec struct {
33
50
// AppId是应用id,字母数字组成,长度5至16位,必须存在
34
51
// +kubebuilder:validation:Pattern="^[a-zA-Z0-9]{5,16}$"
35
52
// +kubebuilder:validation:Required
36
- AppId string `json:"appId "`
53
+ AppId string `json:"appid "`
37
54
38
55
// Buckets是存储桶, 是一个数组,可选存在
39
56
// +kubebuilder:validation:Optional
@@ -49,37 +66,26 @@ type GatewayStatus struct {
49
66
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
50
67
// Important: Run "make" to regenerate code after modifying this file
51
68
52
- // AppDomain 是应用域名,必须存在
53
- // +kubebuilder:validation:Required
54
- AppDomain string `json:"appDomain"`
69
+ // AppRoute 是应用路由
70
+ AppRoute * GatewayRoute `json:"appRoute,omitempty"`
55
71
56
- // BucketDomains 是存储桶域名列表,是一个数组,可选存在
57
- // +kubebuilder:validation:Optional
58
- BucketDomains []string `json:"bucketDomains,omitempty"`
72
+ // BucketRoutes 是存储桶路由
73
+ BucketRoutes map [string ]* GatewayRoute `json:"bucketRoutes,omitempty"`
59
74
60
- // WebsiteDomains 是静态站点域名列表,是一个数组,可选存在
61
- // +kubebuilder:validation:Optional
62
- WebsiteDomains []string `json:"websiteDomains,omitempty"`
75
+ // WebsiteRoutes 是静态站点路由
76
+ WebsiteRoutes map [string ]* GatewayRoute `json:"websiteRoutes,omitempty"`
63
77
}
64
78
65
- // BucketDomain 是存储桶位的域名配置
66
- type BucketDomain struct {
67
- // Name 是存储桶名称,必须存在
68
- // +kubebuilder:validation:Required
69
- Name string `json:"name"`
70
-
71
- // Domain 是存储桶域名,必须存在
79
+ type GatewayRoute struct {
80
+ // DomainName 是域名名称,必须存在
72
81
// +kubebuilder:validation:Required
73
- Domain string `json:"domain"`
74
- }
82
+ DomainName string `json:"domainName"`
75
83
76
- // WebsiteDomain 是静态站点的域名配置
77
- type WebsiteDomain struct {
78
- // Name 是静态站点名称,必须存在
84
+ // DomainNamespace 是域名所在的命名空间,必须存在
79
85
// +kubebuilder:validation:Required
80
- Name string `json:"name "`
86
+ DomainNamespace string `json:"domainNamespace "`
81
87
82
- // Domain 是静态站点域名 ,必须存在
88
+ // Domain 是域名 ,必须存在
83
89
// +kubebuilder:validation:Required
84
90
Domain string `json:"domain"`
85
91
}
0 commit comments