Skip to content

Commit 4b60339

Browse files
committed
Use ogc-capabilities-generator structs
1 parent b12643f commit 4b60339

File tree

4 files changed

+13
-68
lines changed

4 files changed

+13
-68
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ require (
1010
github.com/cbroglie/mustache v1.4.0
1111
github.com/onsi/ginkgo/v2 v2.21.0
1212
github.com/onsi/gomega v1.35.1
13-
github.com/pdok/ogc-specifications v1.0.0-beta1.0.20250331144105-1d17d84aff4d
13+
github.com/pdok/ogc-capabilities-generator v1.0.0-beta5
14+
github.com/pdok/ogc-specifications v1.0.0-beta4
1415
github.com/pdok/smooth-operator v0.0.9
1516
github.com/traefik/traefik/v3 v3.3.4
1617
k8s.io/api v0.32.0

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
137137
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
138138
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
139139
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
140-
github.com/pdok/ogc-specifications v1.0.0-beta1.0.20250331144105-1d17d84aff4d h1:ZwHA+riVR60IaBKbTmHBRT9/ChuY4I4RfqTOtZxwuoo=
141-
github.com/pdok/ogc-specifications v1.0.0-beta1.0.20250331144105-1d17d84aff4d/go.mod h1:YDngwkwrWOfc5MYnEYseiv97K1Y9bZXlVzwi/8EaIl8=
140+
github.com/pdok/ogc-capabilities-generator v1.0.0-beta5 h1:nwkIbFcUW4FIYnf6fLfzpkaIdolQoEhH7yyS8KXNt/g=
141+
github.com/pdok/ogc-capabilities-generator v1.0.0-beta5/go.mod h1:qG2auFy7MDL8Zp1eOfdaUJat+jNW5oLGVd+g7Mbth4Q=
142+
github.com/pdok/ogc-specifications v1.0.0-beta4 h1:/Dgi6ArgR0YPCkErpNyCQTCYMkH/cIfWe+VCoUUZZN0=
143+
github.com/pdok/ogc-specifications v1.0.0-beta4/go.mod h1:YDngwkwrWOfc5MYnEYseiv97K1Y9bZXlVzwi/8EaIl8=
142144
github.com/pdok/smooth-operator v0.0.9 h1:UaOPc23BaHDWzBatSWnOxEjffV0WMiy1LPUkRdqdIGI=
143145
github.com/pdok/smooth-operator v0.0.9/go.mod h1:oZWFuIKJGjN/C6ocgMNfMZ7SbLQi+N0qaWj7j95Wdec=
144146
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

internal/controller/capabilitiesgenerator/mapper.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/cbroglie/mustache"
66
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
77
"github.com/pdok/mapserver-operator/internal/controller/mapperutils"
8+
capabilitiesgenerator "github.com/pdok/ogc-capabilities-generator/pkg/config"
89
"github.com/pdok/ogc-specifications/pkg/wfs200"
910
"github.com/pdok/ogc-specifications/pkg/wsc110"
1011
smoothoperatorv1 "github.com/pdok/smooth-operator/api/v1"
@@ -18,22 +19,22 @@ const (
1819
metadataMediaType = "application/vnd.ogc.csw.GetRecordByIdResponse_xml"
1920
)
2021

21-
func MapWFSToCapabilitiesGeneratorInput(wfs *pdoknlv3.WFS, ownerInfo *smoothoperatorv1.OwnerInfo) (*Config, error) {
22+
func MapWFSToCapabilitiesGeneratorInput(wfs *pdoknlv3.WFS, ownerInfo *smoothoperatorv1.OwnerInfo) (*capabilitiesgenerator.Config, error) {
2223
featureTypeList, err := getFeatureTypeList(wfs, ownerInfo)
2324
if err != nil {
2425
return nil, err
2526
}
2627

27-
config := Config{
28-
Global: Global{
28+
config := capabilitiesgenerator.Config{
29+
Global: capabilitiesgenerator.Global{
2930
Namespace: mapperutils.GetNamespaceURI(wfs.Spec.Service.Prefix, ownerInfo),
3031
Prefix: wfs.Spec.Service.Prefix,
31-
OnlineResourceurl: pdoknlv3.GetHost(),
32+
Onlineresourceurl: pdoknlv3.GetHost(),
3233
Path: mapperutils.GetPath(wfs),
3334
Version: *mapperutils.GetLabelValueByKey(wfs.ObjectMeta.Labels, "service-version"),
3435
},
35-
Services: Services{
36-
WFS200Config: &WFS200Config{
36+
Services: capabilitiesgenerator.Services{
37+
WFS200Config: &capabilitiesgenerator.WFS200Config{
3738
Filename: capabilitiesFilename,
3839
Wfs200: wfs200.GetCapabilitiesResponse{
3940

internal/controller/capabilitiesgenerator/types.go

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)