This repository implements a client for pokemon APIs
-
Clone the repository
git clone https://github.com/codescalersinternships/PokeAPIHTTPClient-RawanMostafa.git
-
Install the dependencies
go mod download
You can configure the endpoint for our client using different ways:
go run cmd/main.go [flags]
- endpoint=ENDPOINT
This is used in case of no passed flags
export VARNAME="my value"
go run cmd/main.go
- ENDPOINT
Our application provides default configurations in case no flags are provided and environment variables aren't set
go run cmd/main.go
const defaultEndpoint = "/machine"
Note: calling an API with known endpoint like Pokemon() will use its endpoint by default
- Check this function to get environment variables :
decideConfigs
- Check this function to get the flags :
getFlags