Skip to content

codescalersinternships/PokeAPIHTTPClient-RawanMostafa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokemon API Client

This repository implements a client for pokemon APIs

Table of Contents

Installation

  1. Clone the repository

    git clone https://github.com/codescalersinternships/PokeAPIHTTPClient-RawanMostafa.git
  2. Install the dependencies

    go mod download

Usage

You can configure the endpoint for our client using different ways:

1. Using flags

 go run cmd/main.go [flags]

Flags:

  • endpoint=ENDPOINT

2. Using environment variables

This is used in case of no passed flags

 export VARNAME="my value"
 go run cmd/main.go 

Environment variables:

  • ENDPOINT

2. Using the default configurations

Our application provides default configurations in case no flags are provided and environment variables aren't set

 go run cmd/main.go 

Default configs:

  const defaultEndpoint = "/machine"

Note: calling an API with known endpoint like Pokemon() will use its endpoint by default

Extra Utilities

  • Check this function to get environment variables : decideConfigs
  • Check this function to get the flags : getFlags

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages