@@ -22,6 +22,7 @@ const (
2222 ServiceTypeWFS ServiceType = "WFS"
2323)
2424
25+ // WMSWFS is the common interface used for both WMS and WFS resources.
2526// +kubebuilder:object:generate=false
2627type WMSWFS interface {
2728 * WFS | * WMS
@@ -35,86 +36,165 @@ type WMSWFS interface {
3536 HasPostgisData () bool
3637 // Sha1 hash of the objects name
3738 ID () string
39+ // URLPath returns the configured service URL
3840 URLPath () string
3941
4042 GeoPackages () []* Gpkg
4143}
4244
45+ // Mapfile references a ConfigMap key where an external mapfile is stored.
46+ // +kubebuilder:validation:Type=object
4347type Mapfile struct {
4448 ConfigMapKeyRef corev1.ConfigMapKeySelector `json:"configMapKeyRef"`
4549}
4650
51+ // Options configures optional behaviors of the operator, like ingress, casing, and data prefetching.
52+ // +kubebuilder:validation:Type=object
4753type Options struct {
54+ // IncludeIngress dictates whether to deploy an Ingress or ensure none exists.
4855 // +kubebuilder:default:=true
4956 IncludeIngress bool `json:"includeIngress"`
5057
58+ // AutomaticCasing enables automatic conversion from snake_case to camelCase.
5159 // +kubebuilder:default:=true
5260 AutomaticCasing bool `json:"automaticCasing"`
5361
62+ // ValidateRequests enables request validation against the service schema.
5463 // +kubebuilder:default:=true
5564 ValidateRequests * bool `json:"validateRequests,omitempty"`
5665
66+ // RewriteGroupToDataLayers merges group layers into individual data layers.
5767 // +kubebuilder:default:=false
5868 RewriteGroupToDataLayers * bool `json:"rewriteGroupToDataLayers,omitempty"`
5969
70+ // DisableWebserviceProxy disables the built-in proxy for external web services.
6071 // +kubebuilder:default:=false
6172 DisableWebserviceProxy * bool `json:"disableWebserviceProxy,omitempty"`
6273
74+ // Whether to prefetch data from blob storage, and store it on the local filesystem.
75+ // If `false`, the data will be served directly out of blob storage
6376 // +kubebuilder:default:=true
6477 PrefetchData * bool `json:"prefetchData,omitempty"`
6578
79+ // ValidateChildStyleNameEqual ensures child style names match the parent style.
80+ // +kubebuilder:default=false
6681 ValidateChildStyleNameEqual * bool `json:"validateChildStyleNameEqual,omitempty"`
6782}
6883
84+ // Inspire holds INSPIRE-specific metadata for the service.
85+ // +kubebuilder:validation:Type=object
6986type Inspire struct {
70- ServiceMetadataURL MetadataURL `json:"serviceMetadataUrl"`
71- SpatialDatasetIdentifier string `json:"spatialDatasetIdentifier"`
72- Language string `json:"language"`
87+ // ServiceMetadataURL references the CSW or custom metadata record.
88+ ServiceMetadataURL MetadataURL `json:"serviceMetadataUrl"`
89+
90+ // SpatialDatasetIdentifier is the ID uniquely identifying the dataset.
91+ SpatialDatasetIdentifier string `json:"spatialDatasetIdentifier"`
92+
93+ // Language of the INSPIRE metadata record (e.g., "nl" or "en").
94+ Language string `json:"language"`
7395}
7496
7597type MetadataURL struct {
76- CSW * Metadata `json:"csw"`
77- Custom * Custom `json:"custom,omitempty"`
98+ // CSW describes a metadata record via a metadataIdentifier (UUID).
99+ CSW * Metadata `json:"csw"`
100+
101+ // Custom allows arbitrary href
102+ Custom * Custom `json:"custom,omitempty"`
78103}
79104
105+ // Metadata holds the UUID of a CSW metadata record
80106type Metadata struct {
107+ // MetadataIdentifier is the record's UUID
108+ // +kubebuilder:validation:Format:=uuid
109+ // +kubebuilder:validation:MinLength:=1
81110 MetadataIdentifier string `json:"metadataIdentifier"`
82111}
83112
113+ // Custom represents a non-CSW metadata link with an href and MIME type.
114+ // +kubebuilder:validation:Schemaless
115+ // +kubebuilder:pruning:PreserveUnknownFields
116+ // +kubebuilder:validation:Type=object
84117type Custom struct {
118+ // +kubebuilder:validation:Pattern=`^https?://.*$`
119+ // +kubebuilder:validation:MinLength=1
85120 Href string `json:"href"`
86121 Type string `json:"type"`
87122}
88123
124+ // Data holds the data source configuration
125+ // +kubebuilder:validation:XValidation:rule="has(self.gpkg) || has(self.tif) || has(self.postgis)", message="Atleast one of the datasource should be provided (postgis, gpkg, tif)"
89126type Data struct {
90- Gpkg * Gpkg `json:"gpkg,omitempty"`
127+ // Gpkg configures a GeoPackage file source
128+ Gpkg * Gpkg `json:"gpkg,omitempty"`
129+
130+ // Postgis configures a Postgis table source
91131 Postgis * Postgis `json:"postgis,omitempty"`
92- TIF * TIF `json:"tif,omitempty"`
132+
133+ // TIF configures a GeoTIF raster source
134+ TIF * TIF `json:"tif,omitempty"`
93135}
94136
137+ // Gpkg configures a Geopackage data source
138+ // +kubebuilder:validation:Type=object
95139type Gpkg struct {
96- BlobKey string `json:"blobKey"`
97- TableName string `json:"tableName"`
98- GeometryType string `json:"geometryType"`
99- Columns []Column `json:"columns"`
140+ // Blobkey identifies the location/bucket of the .gpkg file
141+ // +kubebuilder:validation:Pattern=`\.gpkg$`
142+ BlobKey string `json:"blobKey"`
143+
144+ // TableName is the table within the geopackage
145+ // +kubebuilder:validation:MinLength:=1
146+ TableName string `json:"tableName"`
147+
148+ // GeometryType of the table, must match an OGC type
149+ // +kubebuilder:validation:Pattern:=`^(Multi)?(Point|LineString|Polygon)$`
150+ GeometryType string `json:"geometryType"`
151+
152+ // Columns to visualize for this table
153+ // +kubebuilder:validation:MinItems:=1
154+ Columns []Column `json:"columns"`
100155}
101156
102157// Postgis - reference to table in a Postgres database
158+ // +kubebuilder:validation:Type=object
103159type Postgis struct {
104- TableName string `json:"tableName"`
105- GeometryType string `json:"geometryType"`
106- Columns []Column `json:"columns"`
160+ // TableName in postGIS
161+ // +kubebuilder:validation:MinLength=1
162+ TableName string `json:"tableName"`
163+
164+ // GeometryType of the table
165+ // +kubebuilder:validation:Pattern=`^(Multi)?(Point|LineString|Polygon)$`
166+ GeometryType string `json:"geometryType"`
167+
168+ // Columns to expose from table
169+ // +kubebuilder:validation:MinItems=1
170+ Columns []Column `json:"columns"`
107171}
108172
173+ // TIF configures a GeoTIFF raster data source
174+ // +kubebuilder:validation:Type=object
109175type TIF struct {
110- BlobKey string `json:"blobKey"`
111- Resample * string `json:"resample,omitempty"`
112- Offsite * string `json:"offsite,omitempty"`
113- GetFeatureInfoIncludesClass * bool `json:"getFeatureInfoIncludesClass,omitempty"`
176+ // BlobKey to the TIFF file
177+ // +kubebuilder:validation:Pattern=`\.(tif|tiff)$`
178+ BlobKey string `json:"blobKey"`
179+
180+ // Resample method
181+ Resample * string `json:"resample,omitempty"`
182+
183+ // Offsite color for nodata removal
184+ Offsite * string `json:"offsite,omitempty"`
185+
186+ // Include class names in GetFeatureInfo responses
187+ GetFeatureInfoIncludesClass * bool `json:"getFeatureInfoIncludesClass,omitempty"`
114188}
115189
190+ // Column maps a source column name to an optional alias for output.
191+ // +kubebuilder:validation:Type=object
116192type Column struct {
117- Name string `json:"name"`
193+ // Name of the column in the data source.
194+ // +kubebuilder:validation:MinLength=1
195+ Name string `json:"name"`
196+
197+ // Alias for the column in the service output.
118198 Alias * string `json:"alias,omitempty"`
119199}
120200
0 commit comments