Skip to content

Latest commit

 

History

History
101 lines (89 loc) · 3.3 KB

README.md

File metadata and controls

101 lines (89 loc) · 3.3 KB

rpsls

rpsls (Rock Paper Scissors Lizard Spock) is a Golang REST API learning adventure

Installation

  1. Install & Configure Golang
  1. Validate your installation works
  2. Go get rpsls
go get github.com/symbolgimmicks/rpsls
  1. Using openssl create TSL keys

Testing

Test coverage

  • randomnumber testing RNG BAT RNG 3rd Party Service BAT
  • choice testing Choice BAT part 1 Choice BAT part 2
  • gameservicerouter testing GameService BAT part 1 GameService BAT part 2

Usage

The application attempts to host on port 4077 and is intended to provide the following REST API:

Choices Get all the choices that are usable for the UI. GET: /choices Result: application/json

[
  {
    “id": integer [1-5],
    "name": string [12] (rock, paper, scissors, lizard, spock)
  }
]

Choice Get a randomly generated choice GET: /choice Result: application/json

{
  "id": integer [1-5],
  "name" : string [12] (rock, paper, scissors, lizard, spock)
}

Play Play a round against a computer opponent POST: /play Data: application/json

{
  “player”: choice_id 
}

Result: application/json

{
  "results": string [12] (win, lose, tie),
  “player”: choice_id,
  “computer”:  choice_id
}

Acknowledgment

License