Clone the repository:
git clone https://github.com/apache/synapse-go.git
Check your Go version (optional):
go version
Ensure it meets the minimum requirement.
The Makefile automatically fetches Go module dependencies (via go mod tidy) when you run make for the first time.
To compile the Synapse binary for your local machine
make build
This fetches dependencies (if not already done).
Compiles the Go application and places the binary in the bin/ directory.
To create a zip file (synapse.zip) containing the compiled binary and the required folder structure run:
make package
This will:
Simply running make (or make all) will execute the following steps in order:
make
If you want to remove all build artifacts and start fresh, run:
make clean
This deletes the bin/ folder and any synapse/ directories created during the packaging step.
Customizing the Build
If you need to cross-compile for multiple OS/architectures, you can add additional targets to the Makefile. For example:
build-linux: GOOS=linux GOARCH=amd64 go build -ldflags=$(LDFLAGS) -o bin/$(PROJECT_NAME) $(MAIN_PACKAGE)
Then run:
make build-linux
…and package as usual with:
make package
(Adjust paths and names as needed.)
After you unzip synapse.zip, you will see:
synapse/ ├── bin/ │ └── synapse # Compiled binary └── artifacts/ ├── APIs/ └── Endpoints/
Unzip the archive:
unzip synapse.zip
Run the binary:
cd synapse/bin ./synapse
(On Windows, it would be .\synapse.exe if compiled for Windows.)
Contributing
Fork the repository
Create your feature branch (git checkout -b feature/my-feature)
Commit your changes (git commit -am ‘Add some feature’)
Push to the branch (git push origin feature/my-feature)
Create a new Pull Request
License
Apache 2