Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/earthquakesan/go-rest-client-examples
https://github.com/earthquakesan/go-rest-client-examples
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/earthquakesan/go-rest-client-examples
- Owner: earthquakesan
- License: other
- Created: 2023-02-25T14:33:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-26T11:24:39.000Z (almost 2 years ago)
- Last Synced: 2024-11-16T13:04:49.650Z (3 months ago)
- Language: Go
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-rest-client-examples
## Quick Start Golang Module
```
go mod init github.com/earthquakesan/go-rest-client-examples
go mod tidy# library for REST API requests
go get github.com/imroc/req/v3# library for testing assertions
go get github.com/stretchr/testify# library for logging
go get github.com/rs/zerolog/log# library for yaml demarshalling (reading config)
go get gopkg.in/yaml.v2# library for cli applications
go get -u github.com/spf13/cobra@latest
# see cobra-cli docs: https://github.com/spf13/cobra-cli/blob/main/README.md
go install github.com/spf13/cobra-cli@latest
```## Setup Virtual Env for Python
```
sudo apt-get install python3-pip
pip install virtualenvwrappercat <> ~/.bashrc
export WORKON_HOME=\$HOME/.virtualenvs
export PROJECT_HOME=\$HOME/Devel
export VIRTUALENVWRAPPER_PYTHON=python3
source \$HOME/.local/bin/virtualenvwrapper.shexport PATH=$PATH:$HOME/.local/bin
EOFsource ~/.bashrc
```## Start REST Server
```
mkvirtualenv go-rest-client-examples
pip install -r rest-server/requirements.txt
make start-webserver
```## Init Cobra App
```
cobra-cli init --viper -a "Firstname Lastname"
```## Run Tests
```
make test
```## Run Cobra App Commands
```
go run . company get
```