gwentapi

command module
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2017 License: BSD-3-Clause Imports: 20 Imported by: 0

README

GwentAPI

The code for GwentAPI

GwentAPI is a RESTful API dedicated to provide information regarding GWENT®: The Witcher Card Game. You may use its interface to consume information on cards, factions, etc. You can find the API documentation at https://gwentapi.com/swagger/.

How to use

GwentAPI is release for both Linux and Windows. You can find the download here. The data allowing you to seed the database is included in the releases. Read the file DATABASE_INSTRUCTIONS.md to know how to feed the database.

Change the values found in config.toml to suit your environment. The configuration file must be kept in the same directory as the executable.

Install from source

Requirement & dependencies

  • Bash (use MINGW/git bash or cygwin for windows)
  • Go 1.8
  • MongoDB 3.4
  • Python 3.4.2
    • pymongo 3.4.0
  • Git
  • jq-1.5

Installation

Assuming you installed and configure all the required softwares listed above and that you have a working Go setup:

Build the software
  1. go get github.com/GwentAPI/gwentapi
  2. GwentAPI uses the expimental dep tool to manage the Go dependencies, however they are included in the vendor directory to help build the software on CI platforms.
  3. Change your monboDB credentials in the init() of the /dataLayer/dal/db.go file if needed. By default it connects to localhost on no particular users (no SSL, access control not enabled).
  4. Compile:
    • go build
  5. Optionally set the version of the binary (displayed with the -v flag) by changing the value of version in main.go before compiling or set it at compile time with the following command:
    • go build -ldflags="-X main.version=<versionString>"
  6. Optionally modify the baseURL in the config.toml file to change where resources are pointing to.

The program will run on localhost on port 8080 by default.

How to contribute?

Read the CONTRIBUTING.md file.

Where are the artworks and why does latest.jsonl refers to gwentify?

latest.jsonl is generated by Arachas a web crawler that extract data from gwentify.com.

GwentAPI doesn't hot link to gwentify and so, the database population script will replace the url. The artworks isn't included because git doesn't like binary files and neither do I like including binary files in git.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
dataLayer
dal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL