Skip to content

Improve README #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 49 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
# GoESI "Go Easy" API client for esi

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/O5O33VK5S)

An OpenAPI for EVE Online ESI API.

[![Go Reference](https://pkg.go.dev/badge/antihax/goesi.svg)](https://pkg.go.dev/github.com/antihax/goesi)
![GitHub License](https://img.shields.io/github/license/antihax/goesi)

## Contents

An OpenAPI for EVE Online ESI API
* [Features](#features)
* [Installation](#installation)
* [User Guide](#user-guide)
* [New Client](#new-client)
* [Etiquette](#etiquette)
* [Obeying the Cache Times](#obeying-the-cache-times)
* [ETags](#etags)
* [Authenticating](#authenticating)
* [Passing Tokens](#passing-tokens)
* [Testing](#testing)
* [What about the other stuff?](#what-about-the-other-stuff)
* [API Documentation](#api-documentation)
* [Author](#author)
* [Credits](#credits)

A module to allow access to CCP's EVE Online ESI API.
## Features

Goesi is a module to allow access to CCP's EVE Online ESI API.
This module offers:

* Versioned Endpoints
Expand All @@ -15,11 +37,17 @@ This module offers:

## Installation

You can add goesi to your Go module with the following command:

```go
go get github.com/antihax/goesi
```

## New Client
## User Guide

This chapter describes how you can use goesi in your Go project.

### New Client

```go
client := goesi.NewAPIClient(&http.Client, "MyApp ([email protected] dude on slack)")
Expand Down Expand Up @@ -53,13 +81,13 @@ func main() {
}
```

## Etiquette
### Etiquette

* Create a descriptive user agent so CCP can contact you (preferably on devfleet slack).
* Obey Cache Timers.
* Obey error rate limits: https://developers.eveonline.com/blog/article/error-limiting-imminent
* Obey error rate limits: [Error Rate Limiting Imminent](https://developers.eveonline.com/blog/error-rate-limiting-imminent)

## Obeying the Cache Times
### Obeying the Cache Times

Caching is not implimented by the client and thus it is required to utilize
a caching http client. It is highly recommended to utilize a client capable
Expand Down Expand Up @@ -88,7 +116,7 @@ func main() {
}
```

## ETags
### ETags

You should support using ETags if you are requesting data that is frequently not changed.
IF you are using httpcache, it supports etags already. If you are not using a cache
Expand Down Expand Up @@ -142,9 +170,9 @@ func main() {
}
```

## Authenticating
### Authenticating

Register your application at https://developers.eveonline.com/ to get your secretKey, clientID, and scopes.
Register your application at [EVE Developers](https://developers.eveonline.com/) to get your secretKey, clientID, and scopes.

Obtaining tokens for client requires two HTTP handlers. One to generate and redirect
to the SSO URL, and one to receive the response.
Expand Down Expand Up @@ -235,7 +263,7 @@ func eveSSOAnswer(c *appContext.AppContext, w http.ResponseWriter, r *http.Reque
}
```

## Passing Tokens
### Passing Tokens

OAuth2 tokens are passed to endpoints via contexts. Example:

Expand All @@ -246,30 +274,29 @@ OAuth2 tokens are passed to endpoints via contexts. Example:

This is done here rather than at the client so you can use one client for many tokens, saving connections.

## Testing
### Testing

If you would rather not rely on public ESI for testing, a mock ESI server is available for local and CI use.
Information here: https://github.com/antihax/mock-esi
Information here: [mock-esi](https://github.com/antihax/mock-esi)

## What about the other stuff?
### What about the other stuff?

If you need bleeding edge access, add the endpoint to the generator and rebuild this module.
Generator is here: https://github.com/antihax/swagger-esi-goclient
Generator is here: [swagger-esi-goclient](https://github.com/antihax/swagger-esi-goclient)

## Documentation for API Endpoints
## API Documentation

[ESI Endpoints](./esi/README.md)
* [ESI Endpoints](./esi/README.md)
* [Go reference](https://pkg.go.dev/github.com/antihax/goesi)

## Author

antihax on #devfleet slack

## Credits

https://github.com/go-resty/resty (MIT license) Copyright © 2015-2016 Jeevanandam M ([email protected])
- Uses modified setBody and detectContentType

https://github.com/gregjones/httpcache (MIT license) Copyright © 2012 Greg Jones ([email protected])
- Uses parseCacheControl and CacheExpires as a helper function

* [resty](https://github.com/go-resty/resty) (MIT license) Copyright © 2015-2016 [Jeevanandam M]([email protected])
* Uses modified setBody and detectContentType

* [httpcache](https://github.com/gregjones/httpcache) (MIT license) Copyright © 2012 [Greg Jones]([email protected])
* Uses parseCacheControl and CacheExpires as a helper function