jadi_jan

command module
v0.0.0-...-38b3eca Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 3 Imported by: 0

README

jadi_jan

Build Status GitHub GoDoc Test Coverage Release

This is a very simple project to be a backend for JadiJan. I try to implement active record pattern in this project.

Usage

It has four endpioints:

GET /counter/  # returns how many persons remind jadi ❤️
POST /counter/  # Anther person remind jadi ❤️

GET /comments/ # Returns all comments on lessons they have learned from jadi ❤️
POST /comments/ # Add a comment on lessons they have learned from jadi ❤️
Prerequisites

This project is written in Go and uses echo as http framework. default port is :1323, you can customize it in main.go file. For the sake of performance I used redis as data store. So you need a redis server on default port (:6379), you can customize redis connection in models/store.go file.

Before you get started, make sure you have installed the following tools::

$ python3 -m pip install -U cookiecutter>=1.4.0
$ python3 -m pip install pre-commit bump2version invoke ruamel.yaml halo
$ go get -u golang.org/x/tools/cmd/goimports
$ go get -u golang.org/x/lint/golint
$ go get -u github.com/fzipp/gocyclo/cmd/gocyclo
$ go get -u github.com/mitchellh/gox  # if you want to test building on different architectures

Remember: To be able to excecute the tools downloaded with go get, make sure to include $GOPATH/bin in your $PATH. If echo $GOPATH does not give you a path make sure to run (export GOPATH="$HOME/go" to set it). In order for your changes to persist, do not forget to add these to your shells .bashrc.

With the tools in place, it is strongly advised to install the git commit hooks to make sure checks are passing in CI:

invoke install-hooks

You can check if all checks pass at any time:

invoke pre-commit

Note for Maintainers: After merging changes, tag your commits with a new version and push to GitHub to create a release:

bump2version (major | minor | patch)
git push --follow-tags
Installation

First install a redis server. Then run the following commands:

git clone https://github.com/likecodingloveproblems/jadi_jan.git
cd jadi_jan
go build .
./jadi_jan

Note

Redis data must be CONSISTENT.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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