hasuniversity

command module
v0.0.0-...-f1a2e72 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

GitHub Workflow Status Go Report Card GitHub go.mod Go version GitHub

hasUniversity

API middleware for hasCorp's online learning platform

Running locally

Use docker compose to start. The .local compose file creates and inserts dummy data into the Cassandra instance.

docker compose -f ./docker-compose.local.yml up --build --force-recreate

Clean up the docker network:

docker compose down
Building

Simply done with:

go build .

Or, you can build the docker image by itself:

docker build -t hascorp/hasuniversity -f Dockerfile .
Running

Recommended to run with docker compose, though it is possible to run locally:

go run ./main.go
Testing

Unit tests can be run by executing:

go test -v ./...

The API is exposed to port :8200, so you can curl it:

# ping healthcheck endpoint
curl localhost:8200/

# add a flashcard set to the Cassandra database
curl localhost:8200/flashcard/ -d '{"author": "Murat Piker", "name": "Being a Gigachad", "tags": ["Murat"], "cards": [{"front": "engineer", "back": "NODDERS"}, {"front": "twitch streamer", "back": "NOPERS"}]}'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
route

Jump to

Keyboard shortcuts

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