Skip to content

bancodobrasil/featws-resolver-bridge

Repository files navigation

Go Reference License

Featws Resolver Bridge About_en

How to run

In order to run this project, you need to have certain prerequisites set up on your machine. These prerequisites include:

To run the project, follow these steps:

  • Open the terminal in the project directory and run the command go mod tidy to ensure that all required dependencies are installed.

  • Then, run the command swag init to initialize Swagger and generate the necessary API documentation.

  • Finally, run the command make run to start the project.

The project will run on localhost:9000/. To access the Swagger documentation click here.

By following these steps, the project will be up and running, and you will be able to access the API documentation through Swagger.

Go Reference License

Featws Ruller About_de

  • The featws-ruller project is an implmentation of the grule-rule-engine, used to evalute rulesheets(.grl)

Required Software

  • You must have the Go Programming Language installed in your machine to run this project. You can get the official download here.

  • Clone the featws-transpiler repository to your local machine and make sure both transpiler and ruller project are in the same folder. You can find the featws-transpiler repository here.

Initializate the project

  • Clone this project to your local machine.
  • On main.go folder (../featws-ruller/main.go), open your local terminal and type the command go run main.go, if your OS is windows, you can by build and run the executable go build && ./featws-ruler.exe, or if your OS is mac, type the command go build -o ruller && ./ruller $@.

Testing diferents rulesheets

  • Check if you have in your workspace the featws-transpiler and copy the path from .grl file for the new case, you can find that on the cases tests -> cases
  • Now just replace the env variable "FEATWS_RULLER_DEFAULT_RULES" on .env file on ruller, with the new path, and run like the instructions above.

Testing rulesheet with resolvers

  • To test if the resolver are loaded, you have to set the featws-resolver-bridge URL, on the .env file to.

Load a rulesheet from remote source

  • To load a rulesheet from a remote soure, just change the .env variable "FEATWS_RULLER_RESOURCE_LOADER_URL" pointed to your URL.

Using main endpoints

By default the port will be :8000

GoDoc

To access the GoDoc documentation, first install GoDoc on your machine. Open a terminal and type:

go get golang.org/x/tools/cmd/godoc

Then run the following command in the repository terminal:

godoc -http=:6060

GoDoc will run on localhost:6060. To access the GoDoc documentation, just click here.