8000 GitHub - jku-sr/pokeapi-go
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jku-sr/pokeapi-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pokeapi-go

pokemon

This is a Go API Client for the pokeapi website

You can instantiate the pokeapi client in 2 ways:

1. Supplying a default http.Client to the NewClient method which will create the proper timeout of 2 minutes as well as setting the transport layer to insecure in order to react with the REST API.

    HTTPClient := &http.Client{}

    client := pokeapi.NewClient(HTTPClient)

2. Using the functional options approach and provide an endpoint URL as well as an http.CLient

    HTTPClient := &http.Client{Timeout: time.Millisecond * 100,
    			Transport: &http.Transport{TLSClientConfig: &tls.Config{
    				InsecureSkipVerify: true,
    			}}}

    client := pokeapi.NewClientWIthOpts(
    		pokeapi.OptionBaseURL("https://pokemonurl.com/api"),
    		pokeapi.OptionHTTPClient(HTTPClient))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published
0