Coder Social home page Coder Social logo

star-trek-translation's Introduction

Star Trek challenge

My task was to translate a name written in English to Klingon and find out its species using ​http://stapi.co​.

This code was developed using go1.11.1 windows/amd64

I followed the instructions and started looking forward the main API's to complete this task.

As I started studion the stapi documentation I noticed that in order to get the Star Trek character specie I would need to check two different routes.

First route:

(POST) /v1/rest/character/search

In the above route I would get some generic information about the character, but I won't get the character specie.

To do so, I would need to check the route:

(GET) /v1/rest/character/?uid=%s

Where %s will be the first route response for UID (could be a list).

For this project I split the project in a few packages.

main

  • Where the main project is executed

structures

  • Where the Json parser structures are placed in.

util

  • Where the converters and string maps are.

stapi

  • Where the call to STAPI are made .

I also made the Unit test. Which one are named *_test.go

How to run the project:

  1. Make sure that Golang is installed =)

  2. In the root folder type the following command: go run main.go Uhura

There is a build folder where you can use the application without installing the Golang, but I recommend to use the script above!

Output example:

$ go run main.go Uhura

0xF8E5, 0x​F8D6, ​​​0xF8E5, ​​0xF8E1, 0xF8D0

Human

star-trek-translation's People

Contributors

vilineto avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.