X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=capifcore%2FREADME.md;h=5eea851d0475408ce6f89593a3d6bf698032f37a;hb=9a10485042fb94403cf577a393b945f93ff47655;hp=8e6538287bd7a5c84b2f5952e53c688faf7f162b;hpb=c9e08b2a2f647f9f870040570c5e71305f0fb5d2;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/README.md b/capifcore/README.md index 8e65382..5eea851 100644 --- a/capifcore/README.md +++ b/capifcore/README.md @@ -24,9 +24,38 @@ This product is a Go implementation of the CAPIF Core function, based on the 3GPP CAPIF interfaces. -## Run +## Generation of API code + +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. + +## Build and test -To run the Core Function run the following commands from the top of the repo: +To generate mocks manually, run the following command: + + go generate ./... + +To build the application, run the following command: go build - ./capifcore [-port ] \ No newline at end of file + +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 + +## Run + +To run the Core Function from the command line, run the following commands from this folder. + + ./capifcore [-port ] +