Skip to content

Commit

Permalink
Add support for paging (#94)
Browse files Browse the repository at this point in the history
This patch adds support for the `nextpage_opaque_marker` parameter as
defined in section 5.4 of ETSI GS NFV-SOL 013. A new `NextPageMarker`
field is added to the `ListRequest` and `ListResponse`. The adapter
takes care of encoding and encrypting it, and the handler only needs
to read it from the request or write it to the response. The type of
the field is `[]byte` and the handler that uses it is responsible for
encoding and decoding it if needed.

Related: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/013/03.05.01_60/gs_NFV-SOL013v030501p.pdf

Signed-off-by: Juan Hernandez <[email protected]>
  • Loading branch information
jhernand authored Apr 25, 2024
1 parent e39f1ea commit 5e0b4d7
Show file tree
Hide file tree
Showing 6 changed files with 605 additions and 31 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/peterhellberg/link v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/peterhellberg/link v1.2.0 h1:UA5pg3Gp/E0F2WdX7GERiNrPQrM1K6CVJUUWfHa4t6c=
github.com/peterhellberg/link v1.2.0/go.mod h1:gYfAh+oJgQu2SrZHg5hROVRQe1ICoK0/HHJTcE0edxc=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
20 changes: 20 additions & 0 deletions internal/cmd/server/start_deployment_manager_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ func DeploymentManagerServer() *cobra.Command {
[]string{},
"Extension to add to deployment managers.",
)
_ = flags.String(
externalAddressFlagName,
"",
"External address.",
)
return result
}

Expand Down Expand Up @@ -244,6 +249,21 @@ func (c *DeploymentManagerServerCommand) run(cmd *cobra.Command, argv []string)
slog.Any("extensions", extensions),
)

// Get the external address:
externalAddress, err := flags.GetString(externalAddressFlagName)
if err != nil {
logger.Error(
"Failed to get external address flag",
slog.String("flag", externalAddressFlagName),
slog.String("error", err.Error()),
)
return exit.Error(1)
}
logger.Info(
"External address",
slog.String("value", externalAddress),
)

// Create the logging wrapper:
loggingWrapper, err := logging.NewTransportWrapper().
SetLogger(logger).
Expand Down
Loading

0 comments on commit 5e0b4d7

Please sign in to comment.