Welcome to the SurrealDB Go Starter Project, a solid foundation for your Go projects powered by SurrealDB.
To start a new Go project using this template, you can clone or download this repository.
After you have cloned the repository, you need to set up SurrealDB.
We recommend using Docker, but you can also install SurrealDB directly on your machine.
To set up a Docker container for SurrealDB, run the following command:
docker compose up -ddocker compose stop # Pauses the container
docker compose down # Tears down the container, wiping databrew install surrealdb/tap/surrealmake dbrunNow, you can start coding and developing your Go project.
Use the following golang-ci link to install it for your setup
Run make lint
Run make test
Run make run
- This command retrieves user data from the application. Replace
IshratandShahwith your desired input.
curl --location 'http://0.0.0.0:8080/users' \
--header 'Content-Type: application/json' \
--data '{
"name": "Ishrat",
"surname": "Shah"
}'This project is built for Hacktoberfest 2023, and anyone is welcome to contribute or offer suggestions on how to enhance this template for Go development with SurrealDB.
You are encouraged to open pull requests or issues, and I'll review them as soon as possible.
Happy coding with SurrealDB for Go!
To ensure code quality and that all tests pass before committing, we use pre-commit hooks.
First, install pre-commit using pip:
pip install pre-commitRun the following command to install the pre-commit hook:
pre-commit installYou can run pre-commit manually on all files with:
pre-commit run --all-filesTODO: Move to Epic / Wiki soon
- Basic Main function
- Integrate Go HTTP Router
- Integrate simple GET/POST/PUT/DELETE event
- Integrate DB logic with HTTP Methods
- Integrate GET Method
- Integrate POST Method
- Integrate PUT Method
- Integrate DELETE Method
- Add data to DB
- Add logging
