This product is a Go implementation of the CAPIF Core function, based on the 3GPP CAPIF interfaces.
The CAPIF APIs are generated from the OpenAPI specification provided by 3GPP. The generate.sh
script downloads the specifications from 3GPP, fixes them and then generates the APIs. It also generates the mocks needed for unit testing.
To fix the specifications there are three tools:
commoncollector
, collects type definitions from peripheral specifications to keep down the number of dependencies to other specifications. The types to collect are listed in the definitions.txt
file.enumfixer
, fixes enumeration definitions so they can be properly generated.specificationfixer
, fixes flaws in the specifications so they can be properly generated. All fixes are hard coded.To generate mocks manually, run the following command:
go generate ./...
To build the application, run the following command:
go build
To run the unit tests for the application, run the following command:
go test ./...
The application can also be built as a Docker image, by using the following command:
docker build . -t capifcore
To run the Core Function from the command line, run the following commands from this folder.
./capifcore [-port <port (default 8080)>]