httpjc

command module
v0.0.0-...-5ef7497 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 10 Imported by: 0

README

httpjc

A simple HTTP server that listens on port 8080 to provide password encryption service. The hash is computed as base64 encoded string of the SHA512 hash of the provided password string.

Prerequisites

Installation

go get github.com/edchen1025/httpjc

Launch the Server

# Start standalone httpjc server
httpjc &

POST with a Password

# Submit a password encryption request using /hash endpoint
curl -d "password=angryMoney" http://localhost:8080/hash
# An identifier will be returned
1

GET a Hash

# Get a password hash using /hash/# endpoint
curl http://localhost:8080/hash/1
# A quoted string will be returned
"ZEHhWB65gUlzdVwtDQArEyx+KVLzp/aTaRaPlBzYRIFj6vjFdqEb0Q5B8zVKCZ0vKbZPZklJz0Fd7su2A+gf7Q=="

Statistics

# Request statistical information using /stats endpoint
curl http://localhost:8080/stats
# A JSON object will be returned. The "total" key has the value of the total
# number of requests; the "average" key has the value of the average time taken
# of each request in microseconds.
{"total":1,"average":12}

Shutdown

# Gracefully shutdown this server using /shutdown endpoint
curl http://localhost:8080/shutdown

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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