Skip to content

pequalsnp/go-eveonline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-eveonline

Go package for Eve Online ESI and SDE.

This package is in active development, I am filling in the pieces as I need them. Pull requests are very welcome! If you are using this library and want a particular feature implemented, open an issue and I will try and get to it.

Usage

go get github.com/pequalsnp/go-eveonline

Then in your code

import (
  "github.com/pequalsnp/go-eveonline/pkg/esi"
  "github.com/pequalsnp/go-eveonline/pkg/eveonline"
)

Authorized Requests

The pattern this library uses is compatible with golang.org/x/oauth2. This library allows you to use the Client(ctx, token) function to get a client that will automatically set the access token header properly and handles refreses when needed. I strongly recommend you use it.

Whenever a method takes an authdClient *http.Client it assunmes you will pass in such a client built with a token with the required scopes.

Blueprints

This package can load the blueprints.yml file that ships with the Static Data Export. Here is a simple example:

blueprintsYAMLFile, err := os.Open("./data/blueprints.yaml")
if err != nil {
  wd, _ := os.Getwd()
  log.Fatalf("CWD is `%v` Failed to open blueprint YAML file: %v", wd, err)
}
contents, err := ioutil.ReadAll(blueprintsYAMLFile)
if err != nil {
  log.Fatalf("Failed to read blueprint YAML test data: %v", err)
}
log.Printf("loaded %d bytes from blueprint yaml", len(contents))
blueprints, err := sde.ImportBlueprints(contents)
if err != nil {
  log.Fatalf("Failed to import blueprints: %v", err)
}

Examples

TBD - I know they would be helpful and I will try and add some to this repo.

About

Go package for Eve Online ESI and SDE

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages