@@ -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,177 @@ 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 {
48+ // +kubebuilder:validation:Type=object
4449 ConfigMapKeyRef corev1.ConfigMapKeySelector `json:"configMapKeyRef"`
4550}
4651
52+ // Options configures optional behaviors of the operator, like ingress, casing, and data prefetching.
53+ // +kubebuilder:validation:Type=object
4754type Options struct {
55+ // IncludeIngress dictates whether to deploy an Ingress or ensure none exists.
4856 // +kubebuilder:default:=true
4957 IncludeIngress bool `json:"includeIngress"`
5058
59+ // AutomaticCasing enables automatic conversion from snake_case to camelCase.
5160 // +kubebuilder:default:=true
5261 AutomaticCasing bool `json:"automaticCasing"`
5362
63+ // ValidateRequests enables request validation against the service schema.
5464 // +kubebuilder:default:=true
5565 ValidateRequests * bool `json:"validateRequests,omitempty"`
5666
67+ // RewriteGroupToDataLayers merges group layers into individual data layers.
5768 // +kubebuilder:default:=false
5869 RewriteGroupToDataLayers * bool `json:"rewriteGroupToDataLayers,omitempty"`
5970
71+ // DisableWebserviceProxy disables the built-in proxy for external web services.
6072 // +kubebuilder:default:=false
6173 DisableWebserviceProxy * bool `json:"disableWebserviceProxy,omitempty"`
6274
75+ // Whether to prefetch data from blob storage, and store it on the local filesystem.
76+ // If `false`, the data will be served directly out of blob storage
6377 // +kubebuilder:default:=true
6478 PrefetchData * bool `json:"prefetchData,omitempty"`
6579
80+ // ValidateChildStyleNameEqual ensures child style names match the parent style.
81+ // +kubebuilder:default=false
6682 ValidateChildStyleNameEqual * bool `json:"validateChildStyleNameEqual,omitempty"`
6783}
6884
85+ // Inspire holds INSPIRE-specific metadata for the service.
86+ // +kubebuilder:validation:Type=object
6987type Inspire struct {
70- ServiceMetadataURL MetadataURL `json:"serviceMetadataUrl"`
71- SpatialDatasetIdentifier string `json:"spatialDatasetIdentifier"`
72- Language string `json:"language"`
88+ // ServiceMetadataURL references the CSW or custom metadata record.
89+ // +kubebuilder:validation:Type=object
90+ ServiceMetadataURL MetadataURL `json:"serviceMetadataUrl"`
91+
92+ // SpatialDatasetIdentifier is the ID uniquely identifying the dataset.
93+ // +kubebuilder:validation:MinLength:=1
94+ SpatialDatasetIdentifier string `json:"spatialDatasetIdentifier"`
95+
96+ // Language of the INSPIRE metadata record
97+ // +kubebuilder:validation:MinLength:=1
98+ Language string `json:"language"`
7399}
74100
75101type MetadataURL struct {
76- CSW * Metadata `json:"csw"`
77- Custom * Custom `json:"custom,omitempty"`
102+ // CSW describes a metadata record via a metadataIdentifier (UUID).
103+ CSW * Metadata `json:"csw"`
104+
105+ // Custom allows arbitrary href
106+ Custom * Custom `json:"custom,omitempty"`
78107}
79108
109+ // Metadata holds the UUID of a CSW metadata record
80110type Metadata struct {
111+ // MetadataIdentifier is the record's UUID
112+ // +kubebuilder:validation:Format:=uuid
113+ // +kubebuilder:validation:MinLength:=1
81114 MetadataIdentifier string `json:"metadataIdentifier"`
82115}
83116
117+ // Custom represents a non-CSW metadata link with a href and MIME type.
118+ // +kubebuilder:validation:Type=object
84119type Custom struct {
120+ // +kubebuilder:validation:Pattern=`^https?://.*$`
121+ // +kubebuilder:validation:MinLength=1
85122 Href string `json:"href"`
123+
124+ // MIME type of the custom link
125+ // +kubebuilder:validation:MinLength=1
86126 Type string `json:"type"`
87127}
88128
129+ // Data holds the data source configuration
130+ // +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)"
89131type Data struct {
90- Gpkg * Gpkg `json:"gpkg,omitempty"`
132+ // Gpkg configures a GeoPackage file source
133+ Gpkg * Gpkg `json:"gpkg,omitempty"`
134+
135+ // Postgis configures a Postgis table source
91136 Postgis * Postgis `json:"postgis,omitempty"`
92- TIF * TIF `json:"tif,omitempty"`
137+
138+ // TIF configures a GeoTIF raster source
139+ TIF * TIF `json:"tif,omitempty"`
93140}
94141
142+ // Gpkg configures a Geopackage data source
143+ // +kubebuilder:validation:Type=object
95144type Gpkg struct {
96- BlobKey string `json:"blobKey"`
97- TableName string `json:"tableName"`
98- GeometryType string `json:"geometryType"`
99- Columns []Column `json:"columns"`
145+ // Blobkey identifies the location/bucket of the .gpkg file
146+ // +kubebuilder:validation:Pattern=`\.gpkg$`
147+ // +kubebuilder:validation:MinLength:=1
148+ BlobKey string `json:"blobKey"`
149+
150+ // TableName is the table within the geopackage
151+ // +kubebuilder:validation:MinLength:=1
152+ TableName string `json:"tableName"`
153+
154+ // GeometryType of the table, must match an OGC type
155+ // +kubebuilder:validation:Pattern:=`^(Multi)?(Point|LineString|Polygon)$`
156+ // +kubebuilder:validation:MinLength:=1
157+ GeometryType string `json:"geometryType"`
158+
159+ // Columns to visualize for this table
160+ // +kubebuilder:validation:MinItems:=1
161+ Columns []Column `json:"columns"`
100162}
101163
102164// Postgis - reference to table in a Postgres database
165+ // +kubebuilder:validation:Type=object
103166type Postgis struct {
104- TableName string `json:"tableName"`
105- GeometryType string `json:"geometryType"`
106- Columns []Column `json:"columns"`
167+ // TableName in postGIS
168+ // +kubebuilder:validation:MinLength=1
169+ TableName string `json:"tableName"`
170+
171+ // GeometryType of the table
172+ // +kubebuilder:validation:Pattern=`^(Multi)?(Point|LineString|Polygon)$`
173+ // +kubebuilder:validation:MinLength:=1
174+ GeometryType string `json:"geometryType"`
175+
176+ // Columns to expose from table
177+ // +kubebuilder:validation:MinItems=1
178+ Columns []Column `json:"columns"`
107179}
108180
181+ // TIF configures a GeoTIFF raster data source
182+ // +kubebuilder:validation:Type=object
109183type 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"`
184+ // BlobKey to the TIFF file
185+ // +kubebuilder:validation:Pattern=`\.(tif|tiff)$`
186+ // +kubebuilder:validation:MinLength:=1
187+ BlobKey string `json:"blobKey"`
188+
189+ // Resample method
190+ // +kubebuilder:validation:MinLength:=1
191+ Resample * string `json:"resample,omitempty"`
192+
193+ // Offsite color for nodata removal
194+ // +kubebuilder:validation:MinLength:=1
195+ Offsite * string `json:"offsite,omitempty"`
196+
197+ // Include class names in GetFeatureInfo responses
198+ GetFeatureInfoIncludesClass * bool `json:"getFeatureInfoIncludesClass,omitempty"`
114199}
115200
201+ // Column maps a source column name to an optional alias for output.
202+ // +kubebuilder:validation:Type=object
116203type Column struct {
117- Name string `json:"name"`
204+ // Name of the column in the data source.
205+ // +kubebuilder:validation:MinLength=1
206+ Name string `json:"name"`
207+
208+ // Alias for the column in the service output.
209+ // +kubebuilder:validation:MinLength=1
118210 Alias * string `json:"alias,omitempty"`
119211}
120212
0 commit comments