Documentation
¶
Overview ¶
The Generator package provides a way to generate code for collecting, transfering and saving resources in the agent and api. It also provides functions to fetch the resources.
To run the generator stand in the root folder and run: go run cmd/generator/main.go
The package updates the files:
- cmd/agent/clients/dynamicclient_generated.go
- cmd/agentv2/clients/dynamicclient/dynamicclient_generated.go
- cmd/api/controllers/resourcescontroller/resources_controller_read_generated.go
- cmd/api/services/resourcesService/resourceServices_generated.go
- cmd/tanzu/agent/tanzuservice/schemas/schemas_generated.go
- internal/models/rorResources/extractResource.go
- internal/mongodbrepo/repositories/resourcesmongodbrepo/resourcesinsertupdate_generated.go
If the ror package is available, the package updates the files in the ror package:
- pkg/apicontracts/apiresourcecontracts/resource_models_generated.go
- pkg/apicontracts/apiresourcecontracts/resource_models_methods_generated.go
- pkg/rorresources/fromstruct.go
- pkg/rorresources/resource.go
- pkg/rorresources/rorkubernetes/k8s_test.go
- pkg/rorresources/rorkubernetes/k8s.go
- pkg/rorresources/rortypes/resource_interfaces.go
- pkg/rorresources/rortypes/resource_models_methods.go
- pkg/rorresources/rortypes/resource_input_filter_*.go
The repo github.com/NorskHelsenett/ROR, should be placed in the ../ror folder or the ROR_PATH environment variable should be set to the path.
The input of the package is the []rordefs.ApiResource provided by the "github.com/NorskHelsenett/ror/pkg/rorresources/rordefs" package rordefs in the variable Resources
If new structs are added to the resources, add new structs in the pkg/apicontracts/apiresourcecontracts/* files
TODO: Provide docslink